Forum Discussion
Anonymous
6 years agoNot applicable
How to make average variance with week number
Here is the question: I'd like to show every week average as below: Week01 2 Week02 2.5 Week03 3 Week04 6 I want to show: Week01 =2; Week02 =average(week01,week02)= 2.25; Week03= average(week0...
- 6 years ago
You could do this with a measure like the following
Running Avg = AVERAGEX( Filter(all('Table'),'Table'[Week] <= max('Table'[Week])), 'Table'[Amount]) - 6 years ago
If you want to do a running total within the categories like that I think we'd need to retain the category filters which we could do with an expression like the following:
Running Avg = var catTable = VALUES('Table'[Category]) var dateTable = Filter(ALL('table'),'Table'[Week] <= max('Table'[Week]) && 'Table'[Category] IN catTable) return AVERAGEX( dateTable, 'Table'[Amount]) - Anonymous6 years ago
it really does work. Thank you for your professional answer!
I've tried many times base on your previous answer, found that below formula also can make this happen:
Measure = calculate(average('Table'[Amount]),filter(ALLSELECTED('Table'),'Table'[Category]=max('Table'[Category])),FILTER(ALLSELECTED('Table'),'Table'[Week]<=max('Table'[Week])))
d_gosbell
Super User
6 years agoYou could do this with a measure like the following
Running Avg = AVERAGEX( Filter(all('Table'),'Table'[Week] <= max('Table'[Week])), 'Table'[Amount])
Anonymous
6 years agoNot applicable
Thank you! d_gosbell! superman you are. 🙂