Forum Discussion
DAX Code for Previous Year Rolling Averages
I have read numerous posts on issues surround Rolling Averages, but I have not found one that answers my specific problem.
I have a dashboard for the 2022 Fiscal Year. I need to write a formula that creates a 4 month (and then a separate formula for a 12 month) rolling average, but for the SPLY in 2022. I have used PREVIOUSYEAR, DATESBETWEEN, SAMEPERIODLASTYEAR all to no avail. Either these are the wrong expressions or I am really not understanding how to write this code.
This is my current code. It works exactly as it should for the current year, but even when utilizing date filters on the page, correct results are not returned.
10 Replies
- AnonymousNot applicable
Hi HollyPludeTFA ,
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
- HollyPludeTFAFrequent Visitor
Xiaoxin,
Thank you - I am scrubbing a subset of data and will upload it to a pbix and share.
Holly
- HollyPludeTFAFrequent Visitor
https://drive.google.com/file/d/1fS5OnXZGRuRkqIR3X46qT_wejblmrdLY/view?usp=drive_link
This is a link to my pbix.
Holly
- HollyPludeTFAFrequent Visitor
SS Sales Summary SANDBOX dummy.pbix
I moved the PBIX from Google Drive to OneDrive. I tested the link and it does work now.
Holly
- Ashish_Mathur
Super User
Hi,
Share a small easy to understand dataset and show the expected result in a simple table format on that dummy dataset.