Forum Discussion

amelia's avatar
03-01-2022
Solved

Sum for Rolling 30 Day Window

Hi all, I hope you would be able to help with this. I am creating a dashboard with the week dates as rows, and cumulative sales and sales as 2 columns (as shown in the image below). The cumulative su...
  • Ophir_Buchman's avatar
    03-04-2022

    Hi amelia ,

    You are correct -

    • Your date measure uses a week granularity
    • Your formula's measured value is using a day granularity

    Meaning, that that the data will be cut to that week and only then be aggregated for the last 30 days (pretty much useless as you already filter most of these days).

    There are different resolutions for this depending on your data, business questions, and filtering requirements. The easiest way to resolve this is if you can pre-calculate these numbers in the data model and present them as a simple chart. For example:

    • You create a table of weekly sales and enrich the table with a 30-day history aggregation