Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
GVallentgoed
Helper II
Helper II

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_1-1723048412638.png

 


 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super 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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super 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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.