Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I want to calculate the moving average of the last 5 days with values, I have started with this measure but it counts the last 5 Days with no values
I have a table with the result, the problem is that I want to calculate the last 5 days with [AAAA] values so the last row [FirstDayInPeriod] should be 1/4/2022 and not 1/6/2022.
| Data | ## FirstDayInPeriod | AAAA | ## Moving average 5 days |
| 1/4/2022 | 12/31/2021 | 44.98 | |
| 1/5/2022 | 1/1/2022 | 8.96 | |
| 1/6/2022 | 1/2/2022 | 61.05 | |
| 1/7/2022 | 1/3/2022 | 9.77 | |
| 1/10/2022 | 1/6/2022 | 12.62 | 27.813932 |
Could you help me changing the measure?
THANKS
Solved! Go to Solution.
I have created an improved version,
Hi @rmeng
Please refer to this article from @AlbertoFerrari , it will help a lot https://www.sqlbi.com/articles/rolling-12-months-average-in-dax/
Thanks
Joe
If this post helps, then please Accept it as the solution
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |