Hello
I need to calculate the average of every 4 last values. I have the cumulative average working well but I’m stuck on how to calculate the running average of every 4 values. Please find attached my PBix file with sample data.
Think you’ll be able to achieve this with TOPN because that creates a table you can iterate over but then you’ll have to change the granularity of your Dates table to include time as well…
Actually I finally found a solution. Basically I used RankX to create a RankIndex column based on the datetime column in ASC order. I then calculated the values based on the Max of the RankIndex column.
Attached is my PBix solution file with the desired outcome for anyone who is interested. This is a running total/average of every 4 values. Note in my file how I went back 3 values each time ie Max(RankIndex)-3