Search code examples
ssaspivot-tablepowerpivotdax

Missing a grand total for my month over month measure


I have a measure that gives me the month over month change in budget. The measure is defined as:

Bugdet Month over Month:=if(and(sum(budget[Value])<>0;[Budget, Previous Month]<>0);sum(budget[Value])-[Budget, Previous Month];0)

Budget, Previous Month:=CALCULATE(sum(budget[Value]);PREVIOUSMONTH(tDate[Date]))

When I show Bugdet Month over Month in a pivot table, it shows the correct numbers, but it shows 0 in the grand total. Is it possible to make some change somewhere to make it show the sum of all changes in the grand total?


Solution

  • Rough take is create a third measure:

    Budget Month over Month Final:=SUMX ( VALUES(tdate[Date]), [Budget Month over Month])
    

    This will independently iterate over every month in the given cell and calculated Budget Month over Month and then SUM them together. So for the month row values in your pivot table, this will be the equivalent of the current Budget Month over Month measure.

    And for the Grand Total it will then show the sum of each individual month in the pivot.