March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all - I'd like to do some DAX to get a rolling 12 month figure, then compare that to a rolling 12 month from 2 years ago, but I'm having trouble figuring out how to do it
I have a calendar table with things like 'DATE', 'YEAR', 'MONTH', 'WEEK IN YEAR NUMBER' etc and I'd like to be able to do it for the latest full completed week, so looking back from week 45 in 2021 to week 46 in 2020 and then have the same thing for from week 45 in 2019 to week 46 in 2018 and then a sum that compares the change between the 2 results
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, here’s my solution.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, here’s my solution.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , You need to try measure like
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))
Rolling 12 before 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAXX('Date',dateadd('Date'[Date],-12,month)),-12,MONTH))
For week level with rank you can get similar results
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
80 | |
59 | |
57 | |
43 |
User | Count |
---|---|
186 | |
110 | |
82 | |
63 | |
50 |