Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Rolling Max in calcaluated column

Hi. I need to make a rolling max in a calculated column, which calculates the maximum value for the last 200 hours, of the Msteam. I have data for every hour of the year. My data looks like th...
  • v-cherch-msft's avatar
    v-cherch-msft
    7 years ago

    Hi Anonymous 

    You may add an index column in query editor first.Then create the measure:

    Measure =
    CALCULATE (
        MAX ( Table1[Msteam] ),
        FILTER (
            ALL ( Table1 ),
            Table1[Index]
                > MAX ( Table1[Index] ) - 200
                && Table1[Index] <= MAX ( Table1[Index] )
        )
    )
    

    Regards,