Forum Discussion
How do you calculate the rolling average per week/month?
- Anonymous5 years ago
Hi mdbuzzer ,
1.Create three calculated columns.
weeknum = WEEKNUM([Date],2)Average = CALCULATE(AVERAGE('Table'[Value]),ALLEXCEPT('Table','Table'[weeknum]))week = WEEKDAY([Date],2)2.Create a new table and create a relationship with main table.
Table 2 = FILTER('Table',[week]=3)3.Create a calculated column in the new table.
Rolling average = CALCULATE(SUM('Table 2'[Average]),FILTER(ALL('Table 2'),[Date]<=EARLIER('Table 2'[Date])))4.The result is as follows.
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi mdbuzzer ,
1.Create three calculated columns.
weeknum = WEEKNUM([Date],2)Average = CALCULATE(AVERAGE('Table'[Value]),ALLEXCEPT('Table','Table'[weeknum]))week = WEEKDAY([Date],2)
2.Create a new table and create a relationship with main table.
Table 2 = FILTER('Table',[week]=3)
3.Create a calculated column in the new table.
Rolling average = CALCULATE(SUM('Table 2'[Average]),FILTER(ALL('Table 2'),[Date]<=EARLIER('Table 2'[Date])))
4.The result is as follows.
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Perfect! Thank you, that's exactly what I was looking for