Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Rolling average without dates

I have a dataset that contains batch numbers and cycle times for each batch number. I am trying to create a rolling average over the last 5 batches to plot. Those are the only two variables - I do no...
  • Anonymous's avatar
    Anonymous
    6 years ago

    I found out how to do it minutes after I posted on the forum. I found a calculated column code which works exactly how I want it. 

    Column = 
    var my_index = 'Table'[Index]
    var my_result = 
        AVERAGEX(
            FILTER(
                'Table',
                'Table'[Index] > my_index-5 &&
                'Table'[Index] <= my_index
            ), 'Table'[Parameter]
        )
    RETURN my_result

    This makes a rolling average of the last 5 parameters. You will need to create an index column, but that's the only thing you should need to create in order to graph a rolling average.