Forum Discussion
Calculate YOY% Difference
I am trying to get a visual that dynamically shows the difference between 2 years (+1.26%), however my formula is giving me an incorrect value. I am trying to get the forumla to calculate the average of each year divided by the maximum (56) and subtract those percenatges from eachother: formula below. using each side of the equation by itself gives me the correct value for each year. But trying to subtract them from eachother gives me an incorrect value.
PLT DIF = IF('TLO (2)'[Latest Pickup].[Year]=2024,CALCULATE(DIVIDE(AVERAGE('TLO (2)'[PLT]),56))) - (IF('TLO (2)'[Latest Pickup].[Year]=2023,CALCULATE(DIVIDE(AVERAGE('TLO (2)'[PLT]),56)))
GVallentgoed , You should join date of you table with date of a Dat table and then try like
Assume you have measure M1 for this year
Year behind = CALCULATE([M1],dateadd('Date'[Date],-1,Year))
Year behind = CALCULATE([M1],SAMEPERIODLASTYEAR('Date'[Date]))Then YOY Measure
YOY% = divide([M1] -[Year behind], [Year behind])
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
1 Reply
- amitchandakSuper User
GVallentgoed , You should join date of you table with date of a Dat table and then try like
Assume you have measure M1 for this year
Year behind = CALCULATE([M1],dateadd('Date'[Date],-1,Year))
Year behind = CALCULATE([M1],SAMEPERIODLASTYEAR('Date'[Date]))Then YOY Measure
YOY% = divide([M1] -[Year behind], [Year behind])
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA