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.
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?
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 |
---|---|
117 | |
104 | |
77 | |
73 | |
52 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |