Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
15 | |
10 | |
9 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
12 | |
11 | |
10 |