Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi everybody,
I'm creating a monthly rolling average per type using data which has daily records. The DAX I created is not working for monthly rolling average.
Below is what the data looks like:
I created this DAX to get the rolling average wherein it will sum the count of x days and divide it by x days :
For example:
For date 01/03/2023 above, the sum of count is 31. It needs to be added to the previous date wherein 31+144 = 175 . Then divide it by 2 since we are using two consecutive days. (175)/2 = 88
For date 01/04/2023 above, the sum of count is 69. It needs to be added to the previous dates wherein 69+31+144 = 244 . Then divide it by 3 since we are using three consecutive days. (244)/3 = 81
But if I remove the daily date field and use only the monthly field, it is not giving me the correct monthly rolling average below. Will you be able to assist me on the correct DAX to use?
Here is the link containing the sample data for reference.
https://www.dropbox.com/scl/fi/1rfq3smago90ugbzrp5nq/Sample-October-20-2023.pbix?rlkey=wgnp2tqjw98py...
Appreciate your kind help.
Best regards,
Mark V.
Solved! Go to Solution.
Hi @markefrody
To use these kinds of calculations inefficient way you should add dates table to your model as a first step:
Mark it a dates table:
and then modify your measure to:
Hi @markefrody
To use these kinds of calculations inefficient way you should add dates table to your model as a first step:
Mark it a dates table:
and then modify your measure to:
@Ritaf1983
Hi Rita,
Thank you very much for your solution. Confirm it works. Thanks again. Really appreciate it.
Best regards,
Mark V
You're welcome ☺️
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
85 | |
83 | |
66 | |
60 | |
57 |
User | Count |
---|---|
188 | |
111 | |
105 | |
78 | |
71 |