Forum Discussion
michaeldonnelly
6 years agoFrequent Visitor
Rolling/Moving Average - Sports form guide
HI all, im looking to create a rolling average of the last 6 matches played by a team, so in the data below, what are the average points per game from the last 6, obviously this would be different pe...
- 6 years ago
Hi michaeldonnelly ,
try this.
Rolling AVG Points last 6 matches = CALCULATE ( AVERAGE ( 'Table'[Points] ), TOPN ( 6, FILTER ( ALLSELECTED ( 'Table'[Date] ), 'Table'[Date] <= MAX ( 'Table'[Date] ) ), 'Table'[Date], DESC ) )Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
az38
Community Champion
6 years agoyou could create a measure like this if I undersyant correct "rolling average"
Measure =
calculate(average(Table1[Points]);TOPN(6;filter(ALL(Table1);Table1[Date]<=SELECTEDVALUE(Table1[Date]) && Table1[Team Name]=selectedvalue('Table1'[Team Name]));Table1[Date];DESC))do not hesitate to give a kudo to useful posts and mark solutions as solution