Forum Discussion
Rolling average without dates
- Anonymous6 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_resultThis 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.
Can you create a rank column and use?
Rank = rank(all(table),batch,,desc,dense)
last 3 period =
var _max =maxx(table,table[rank])
var _min=maxx(table,table[rank])-3
calculate(sum(table[qty]), filter(all(table),table[rank]>= _min && table[rank]>=_max ))
But move batch to a different table and then do it
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin