Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I see a lot of questions on here about the rolling average however I cannot get any of them to work for my problem. I need a rolling 12 month average that is not affected by the slicer control (ie. not to reset at the start of the filtered table).
I need to SUM the last 12 months of [N2 Component] and Divide by the SUM of the last 12 months of [Total Sold]. To create a rolling 12 month average. I need it to go further than the selected dates in the slicer. Ie. Not to restart at July 2022, the July number should be July 2022 - Aug 2021. And should be blank if there is no data in the N2 or Total Sold
I have a separate Date Table. Unfortunately I cannot upload a sample of my files, only images - apologies! I hope someone can help, I feel like this is very simple, just can't get my head around it.
TIA 🙂
Solved! Go to Solution.
Solved using Amitchandak's reply in this thread:
https://community.fabric.microsoft.com/t5/Desktop/Rolling-12-months-average/m-p/1653290#M662163
Hope this tutorial helps.
Calculate Dynamic Rolling Average in PowerBI using a Slider | MiTutorials - YouTube
Hi @JNelson ,
You can try out this example :-
Here are the steps you can follow:
1. Create measure.
Sum =
var _1=
IF(MAX([month])<>12,
CALCULATE(MAX('Table'[Month-Year]),FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])-1&&'Table'[month]=MAX('Table'[month])+1)),
DATE(YEAR(MAX([Month-Year])),1,1))
var _2=
CALCULATE(
SUM('Table'[Value]),
FILTER(ALL('Table'),[Month-Year]>=_1&&[Month-Year]<=MAX([Month-Year])))
return _2
Sum/12 =
var _1=
IF(MAX([month])<>12,
CALCULATE(MAX('Table'[Month-Year]),FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])-1&&'Table'[month]=MAX('Table'[month])+1)),
DATE(YEAR(MAX([Month-Year])),1,1))
var _2=
CALCULATE(
SUM('Table'[Value]),
FILTER(ALL('Table'),[Month-Year]>=_1&&[Month-Year]<=MAX([Month-Year])))
return _2/12
Thanks ,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
Proud to be a Super User!
Solved using Amitchandak's reply in this thread:
https://community.fabric.microsoft.com/t5/Desktop/Rolling-12-months-average/m-p/1653290#M662163
Can you please describe how the calendar table should look? I'm a bit confused with the [Month] [Month-Year] [Year] measures you're referring to? Should I split my date column out into those three?
Thanks
Hi @JNelson ,
Yes you can add 3 columns .
You can refer to this link for more info regarding calender table in power bi :-
https://hevodata.com/learn/power-bi-calendar-table/
Thanks ,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
95 | |
80 | |
67 | |
62 |
User | Count |
---|---|
146 | |
110 | |
107 | |
86 | |
63 |