Help with getting dynamic aggregations

Hi there!

I am trying to get a calculation that shows, for each day and category, the total sales from the past 28 days.

For example, if the value in a row is 2022-12-09, I need to see the sum of sales from 2022-11-11 to 2022-12-09. If the value is 2022-12-10, the sum of sales should start from 2022-11-12 to 2022-12-10, and so on.

The structure of my table is very simple:

Any ideas would be much appreciated!

Hi Patricia and welcome to the Community!

See this topic: How to calculate a rolling aggregate

Let me know if you still have questions about rolling aggregates.