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.
I've tried numerous different ways of calculating a rolling 8 week average, but just can't seem to get it to work.
Through my errors I've experienced a result of the average being the same value of the week, blank, or all the same value for every location.
Below is a sample of my data, date key, and my datamodel. Also one of the DAX formulas I've used.
Solved! Go to Solution.
@Jaf017 , Refer my blog for that
Rolling 8 week Sales = CALCULATE(SUM(Sales[Net Sales]),FILTER(all('Date'),'Date'[Week Rank]>=min('Date'[Week Rank])-8 && 'Date'[Week Rank]<=max('Date'[Week Rank])))
or
Next 8 Week Sales =
Var _min = maxx(allselected('Date','Date'[Week Rank])
Var _max = maxx(allselected('Date','Date'[Week Rank]) -8
CALCULATE(SUM(Sales[Net Sales]),FILTER(all('Date'),'Date'[Week Rank]>=_min && 'Date'[Week Rank]<=_max))
@Jaf017 , Refer my blog for that
Rolling 8 week Sales = CALCULATE(SUM(Sales[Net Sales]),FILTER(all('Date'),'Date'[Week Rank]>=min('Date'[Week Rank])-8 && 'Date'[Week Rank]<=max('Date'[Week Rank])))
or
Next 8 Week Sales =
Var _min = maxx(allselected('Date','Date'[Week Rank])
Var _max = maxx(allselected('Date','Date'[Week Rank]) -8
CALCULATE(SUM(Sales[Net Sales]),FILTER(all('Date'),'Date'[Week Rank]>=_min && 'Date'[Week Rank]<=_max))
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 |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |