Forum Discussion
mp390988
Post Partisan
1 year agoTotal column when calculating the difference between 2 matrices
Hi, I have two matices, one showing values for current year and the other showing values for the previous year. Then I need to calculate the difference between the two matrices. So far, I got thi...
MFelix
Super User
1 year agoHi mp390988
Try the following code:
RevDiff =
VAR CurrentYearRev = CALCULATE(
SUM(TradesPlus[GBPRevenue]),
'Calendar'[RelativeYear] = "Year"
)
VAR PrevYearRev = CALCULATE(
SUM(TradesPlus[GBPRevenue]),
'Calendar'[RelativeYear] = "Year-1"
)
RETURN
SUMX( SUMMARIZE(TradesPlus, TradesPlus[Group],"VS", CurrentYearRev - PrevYearRev ),
[VS] )
Be aware that this may need some adjustments did it by head, not in PBI currently.