Forum Discussion

michaeldonnelly's avatar
michaeldonnelly
Frequent Visitor
6 years ago
Solved

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...
  • mwegener's avatar
    mwegener
    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.