Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi there
I have 3 columns of data 'Date', 'Institution', and 'Sales'. I am wanting to calculate a measure that give the year on year % change in sales for each institution.
I have been using quick measure for year over year change functin for aggregate sales, but having an issue with finding code that incorporates another column, (i.e. instituion) so as to present % changes for each institution year on year.
Solved! Go to Solution.
Hi,
The general structure for YoY % change calculations is as follows:
VAR LastYear = CALCULATE ( selectedmeasure(), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) ) RETURN DIVIDE(selectedmeasure()-LastYear,LastYear)
This is an calculation group example so replace "selectedmeasure" with yout calculation logic. So for example something like SUM('Sales'[values]). If your Sales table has a relationship to 'instittututions' and 'calendar' this code should also account for those dimensions.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
Thanks for your response. Although this calculation is returning all YoY% figures as 0.00%.
This is the code I used.
Hi,
The general structure for YoY % change calculations is as follows:
VAR LastYear = CALCULATE ( selectedmeasure(), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) ) RETURN DIVIDE(selectedmeasure()-LastYear,LastYear)
This is an calculation group example so replace "selectedmeasure" with yout calculation logic. So for example something like SUM('Sales'[values]). If your Sales table has a relationship to 'instittututions' and 'calendar' this code should also account for those dimensions.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
Thanks for your response ValtteriN. Although this calculation is returning all YoY% figures as 0.00%.
This is the code I used.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 21 | |
| 10 | |
| 8 | |
| 8 |