Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hello,
Any idea on how a dynamic rolling average and spend be dynamic based on slicers?
I just noticed that the numbers do not change when I use different slicers such as World Area, Commodity, etc.
I have attached here the pbi file.
https://drive.google.com/file/d/1XhnWQcAFO1i15tz-Ukna2TjdFL0UKT_8/view?usp=sharing
Herewith my formula:
Solved! Go to Solution.
@jovendeluna21 , With help from the date table, measures like example measure should help
Rolling 30 = calculate(AverageX(Values('Date'[Date]),CALCULATE(sum(Sales[Sales Amount]))),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-30,DAY))
@jovendeluna21 , With help from the date table, measures like example measure should help
Rolling 30 = calculate(AverageX(Values('Date'[Date]),CALCULATE(sum(Sales[Sales Amount]))),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-30,DAY))
tried this one but giving me incorrect number
@jovendeluna21 , For Days Avg
Rolling N = calculate(AverageX(Values('Date'[Date]),CALCULATE(sum('AVE PAYMENT TERMS RAW DATA'[TOTAL_SPEND]))),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-1* [Parameter Value],MONTH))
For Months Avg// Sum till month Avg post that
Rolling N = calculate(AverageX(Values('Date'[Month Year]),CALCULATE(sum('AVE PAYMENT TERMS RAW DATA'[TOTAL_SPEND]))),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-1* [Parameter Value],MONTH))
@jovendeluna21 , For Days Avg
Rolling N = calculate(AverageX(Values('Date'[Date]),CALCULATE(sum('AVE PAYMENT TERMS RAW DATA'[TOTAL_SPEND]))),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-1* [Parameter Value],MONTH))
For Months Avg// Sum till month Avg post that
Rolling N = calculate(AverageX(Values('Date'[Month Year]),CALCULATE(sum('AVE PAYMENT TERMS RAW DATA'[TOTAL_SPEND]))),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-1* [Parameter Value],MONTH))
Still wrong, actually the numbers I have are already correct using my previous DAX measures, it's just that when I use other slicers the numbers do not change, which should be.
| User | Count |
|---|---|
| 50 | |
| 43 | |
| 36 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 139 | |
| 129 | |
| 61 | |
| 59 | |
| 57 |