Forum Discussion
Stroop
9 years agoFrequent Visitor
Year On year comparisons
Hi I have a table showing bookings for each month this year and last year. I have a second table showing YOY differences where the YOY difference is calculated by YoY_diff = VAR CurrentD...
- 9 years ago
Hi Stroop,
According to your description above, using DIVIDE function in your formula like below should work in this scenario. :smileyhappy:
YoY_diff = VAR CurrentDate = MAX ( 'exptemp fullyon'[date] ) VAR lastyear = CALCULATE ( 'data1'[Sum_Bookings], 'exptemp fullyon'[foyear] = YEAR ( CurrentDate ) - 1 ) VAR thisyear = CALCULATE ( 'data1'[Sum_Bookings], 'exptemp fullyon'[foyear] = YEAR ( CurrentDate ) ) RETURN DIVIDE ( thisyear - lastyear, lastyear )Regards
v-ljerr-msft
Microsoft Employee
9 years agoHi Stroop,
According to your description above, using DIVIDE function in your formula like below should work in this scenario. :smileyhappy:
YoY_diff =
VAR CurrentDate =
MAX ( 'exptemp fullyon'[date] )
VAR lastyear =
CALCULATE (
'data1'[Sum_Bookings],
'exptemp fullyon'[foyear]
= YEAR ( CurrentDate ) - 1
)
VAR thisyear =
CALCULATE (
'data1'[Sum_Bookings],
'exptemp fullyon'[foyear] = YEAR ( CurrentDate )
)
RETURN
DIVIDE ( thisyear - lastyear, lastyear )
Regards
Stroop
9 years agoFrequent Visitor
That's worked perfectly, thanks.