To implement this recipe, do the following:
- Create a column in the R04_Project table using the following formula:
Actual Cost =
VAR __Table =
ADDCOLUMNS(
ADDCOLUMNS(
RELATEDTABLE('R04_Hours'),
"__Cost_Per_Hour",
RELATED('R04_Resources'[Cost_Per_Hour])
),
"__Actual Cost",
[Hours] * [__Cost_Per_Hour]
)
RETURN
SUMX(__Table,[__Actual Cost])
- Create the following measure:
AC =
VAR __Date = MAX('R04_Calendar'[Date])
VAR __Table =
ADDCOLUMNS(
ADDCOLUMNS(
FILTER('R04_Hours', 'R04_Hours'[Date] <= __Date),
"__Cost_Per_Hour",
RELATED('R04_Resources'[Cost_Per_Hour])
),
"__AC",
[Hours] * [__Cost_Per_Hour]
)
RETURN
SUMX(__Table,[__AC])
- On a Report page, create a matrix visualization and place the Project, Phase, and Name columns from the R04_Project table into the Rows area with the Project column being at the top, then the Phase column, and the Name column at the bottom.
- In the same matrix visualization, place the Actual Cost column from the R04_Project table into the Value area.
- On the same Report page, create a line chart visualization and place the Date column from the R04_Calendar table into the Axis area. Ensure that this field is set to Date and not Date Hierarchy.
- In the same line chart visualization, place the AC measure into the Value area.