Hello!
I am attempting to compare budgeted vs. actual costs per full-time employee using PowerPivot, and running into some challenges. I want to display the running total in a line chart, and for the line to stop when there is no more data.
A demonstration, using total costs (not per FTE)
The code for the measure that displays the correct result is:
All good, right? Well, not exactly. To calculate the amount per FTE, I'm using another simple measure:
Because SUM only takes a reference to a column, I am unable to re-use the code from Cumulative amount, and now I am stuck. I've tried all sorts of TOTALYTD, CALCULATE and SUMX combinations, but I am either getting non-cumulative and/or otherwise incorrect values. Had SUM([Measure]) worked, I could simply have done:
- but no such luck.
For example, the following code produces incorrect values that are also not cumulative, as seen here:
Using the built-in PivotTable Running total correctly displays the cumulative values, but fills blank cells with the last value.
The data model is still being worked on, but should be pretty straight forward: two fact tables (Transactions and Employees) and a set of dimension tables, including one for dates.
I'm (almost) sure this is actually a no-brainer, but my brain has met its match. Does anyone know what to do here?
Thanks!
I am attempting to compare budgeted vs. actual costs per full-time employee using PowerPivot, and running into some challenges. I want to display the running total in a line chart, and for the line to stop when there is no more data.
A demonstration, using total costs (not per FTE)
- I do not want this (default behavior for the built-in PivotTable Running total): Bad line
- I want this (simple measure): Nice line
The code for the measure that displays the correct result is:
Code:
Cumulative amount:=IF(ISBLANK([Sum of Amount]);BLANK();TOTALYTD(SUM(Transactions[Amount]);DimDate[Date]))
All good, right? Well, not exactly. To calculate the amount per FTE, I'm using another simple measure:
Code:
Amount per FTE:=SUM(Transactions[Amount]) / SUM(Employees[FTE])
Because SUM only takes a reference to a column, I am unable to re-use the code from Cumulative amount, and now I am stuck. I've tried all sorts of TOTALYTD, CALCULATE and SUMX combinations, but I am either getting non-cumulative and/or otherwise incorrect values. Had SUM([Measure]) worked, I could simply have done:
Code:
Cumulative amount per FTE:=IF(ISBLANK([Sum of Amount]);BLANK();TOTALYTD(SUM([Amount per FTE]);DimDate[Date]))
For example, the following code produces incorrect values that are also not cumulative, as seen here:
Code:
Cumulative APF:=IF(ISBLANK([Sum av Amount]);BLANK();TOTALYTD(SUM(Transactions[Amount])/SUM(Employees[FTE]); DimDate[Date]))
Using the built-in PivotTable Running total correctly displays the cumulative values, but fills blank cells with the last value.
The data model is still being worked on, but should be pretty straight forward: two fact tables (Transactions and Employees) and a set of dimension tables, including one for dates.
I'm (almost) sure this is actually a no-brainer, but my brain has met its match. Does anyone know what to do here?
Thanks!