March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
I have a DAX formula which helps me calculating a 7 day moving average, as follows:
Solved! Go to Solution.
hi, @Anonymous
You could add a conditional in your formula as below:
Rolling AVG - 7 days = CALCULATE ( SUM ( val_summary_by_day_source_tv_region[vals_booked] ) / 7, DATESINPERIOD ( 'Calendar Reference'[Date_2], LASTDATE ( 'Calendar Reference'[Date_2] ), -7, DAY ), ALLEXCEPT ( val_source_ref_lookup, val_source_ref_lookup[val_business_category] ), FILTER ( ALL ( 'Calendar Reference' ), MAX ( 'Calendar Reference'[Date_2] ) < TODAY () ) )
Result:
Best Regards,
Lin
hi, @Anonymous
You could add a conditional in your formula as below:
Rolling AVG - 7 days = CALCULATE ( SUM ( val_summary_by_day_source_tv_region[vals_booked] ) / 7, DATESINPERIOD ( 'Calendar Reference'[Date_2], LASTDATE ( 'Calendar Reference'[Date_2] ), -7, DAY ), ALLEXCEPT ( val_source_ref_lookup, val_source_ref_lookup[val_business_category] ), FILTER ( ALL ( 'Calendar Reference' ), MAX ( 'Calendar Reference'[Date_2] ) < TODAY () ) )
Result:
Best Regards,
Lin
Hi @Anonymous
Can you show how/where you are using the measure? I mean, is it on a matrix visual? If so, what are you placing in the rows of the matrix?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |