Trying to calculate Rolling Averages/Sums over the previous year

Hey all,

I have been stumped trying to figure out how to create a specific calculation. Let's say I have a column that counts number of orders and one that counts dates of orders by month. I want a way to calculate the total count (or sum) over the previous 12 months specifically, and display these results on a line graph for the last year.

So for example, the line graph should run from May 2022-May2023. I want the data point for May 2022 to show the total count of all orders from May 2021-May 2022. The June 2022 point shows the total count of all orders from June 2021-June 2022, etc. up until we get to currently, May 2023. The final data point should then show all data from May 2022-May 2023. Is it possible to have this as a Beast Mode calculation and then be able to display on a rolling 12 month total count for each given month?

Best Answer

  • trafalger
    trafalger Coach
    Answer ✓

    You'd have to do this in the dataflow -basically join the 12 prior monts to each month (Aka, April's date would have the prior 12 months appended to it and all have a "Report Date" of April, so in analyzer when you select April you'd have the 12 months there). If you don't want the ability to drill, you could aggregate this before appending it.

Answers

  • trafalger
    trafalger Coach
    Answer ✓

    You'd have to do this in the dataflow -basically join the 12 prior monts to each month (Aka, April's date would have the prior 12 months appended to it and all have a "Report Date" of April, so in analyzer when you select April you'd have the 12 months there). If you don't want the ability to drill, you could aggregate this before appending it.