Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Guys,
We have below data
yr qty salamt
2021 100 20000
2020 2 200
2019 3 99
We would like to get AVG price yoy
2021 =20000/100= 200
2020 =200/2= 100
2019 =99/3= 33
We achieved above by simple dax
CY=calculate(salamt/qty,dateadd(dimdate,1,Year))
PY =dateadd(dimdate,1,Year) replaced 1 with -1
PY-1=dateadd(dimdate,1,Year) replaced 1 with -2
Change Per Year= cy-py/qty py
dynamically for all years
but what if have to do it for 20 yrs [By above method i end up creating 20 measures], i dont want to create 20 measures, Can i pass middle value as dynamic paramter based on year filter? or Some Dummy table?
Regards,
Sneevand
Hi @sneevand ,
Please refer to these thread:
https://community.powerbi.com/t5/Desktop/YoY-Calculations/m-p/342299
https://community.powerbi.com/t5/Desktop/YoY-Qty-Measure/m-p/1604993
Then use the year slicer to dynamically display the comparison with the previous year.
If the problem persists,could you share the sample pbix via cloud service like onedrive for business?
Please remove any sensitive data before uploading.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@sneevand not sure why you will do that, you just need to create 3 measure and you should use date dimension and then use previousyear dax function to get value for the previous year, which means whatever year you are looking at, you will get previous year value.
There are tons of posts on time intelligence and previous year calculations.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |