Forum Discussion
jonbrooker
2 years agoHelper I
Calculating difference from previous year by area
Hi, I wonder if anyone can help me with what I was hoping would be a relatively common calculation, but I've so far failed to find a solution. I need to calculate the difference in [Value] from the ...
- 2 years ago
Kaviraj11
2 years agoSolution Sage
Hi,
To work with time intelligence function, we must have a date/calendar table. Make sure to have it created and relationship is created. Additionally, use the Year column(hierarchy) from the Date column of Date/Calendar Table
Next, you create a previous year value/data as:
Previous Year =
VAR PREVIOUS=CALCULATE(SUM(Table[Value]),PREVIOUSYEAR('Calendar'[Date].[Date]))
RETURN IF(ISBLANK(PREVIOUS),0,PREVIOUS)
Second Measure:
Difference = SWITCH(TRUE(),[Previous Year]=0,BLANK(),CALCULATE(SUM(Table[Value])-[Previous Year)