Home » excel » excel – Calculated field totals not correct in PowerPivot

# excel – Calculated field totals not correct in PowerPivot

Questions:

I have a basic data set with a ton of slicers that roughly looks like this:

5.00        5.00          25.00
10.00       2.00          20.00
8.00       10.00          80.00

Where Spread is a calculated value where Spread = Hours*SpreadPerHour. The problem is, the totals for these columns follow this formula too, so it looks like this:

5.00        5.00          25.00
10.00       2.00          20.00
8.00       10.00          80.00
Total: 23.00      17.00         391.00

And while the hours total up just fine, SpreadPerHour is dynamic and so Spread is as well. It is incorrect to say Total Spread = Total Hours * Total SpreadPerHour. Totals should be:

Total: 23.00      17.00         125.00

Is there a way I can make excel leave totals for Hours as-is, but sum the column for Spread instead of multiplying totals?

Here is what I think you have in your Power Pivot Model:

You have a calculated measure for Spread, which I have labeled SpreadCalc1. The problem with this is that it does the aggregation before it does the multiplication. You need this operation to be done on a row-by-row basis and then aggregated. So instead of a calculated measure, you need to create a calculated column and then sum that column.

The column I have labeled as SpreadCalc has the formula =[Hours] * [SpreadPerHr].
The calculated measure I called Spread is just Sum([SpreadCalc]). You can see there that the total is 125 as desired instead of 391.