Request A Video Series: ​DAX Tip – Last N Weekly Rolling Calculation​

Опубликовано: 16 Октябрь 2024
на канале: Data Platform Central
2,463
32

A quick demo to illustrate how rolling window calculation based on weeks can be performed using DAX code inside Power BI model.
The demo also explains how we can make it dynamic by adding a slicer for selecting the rolling window size.

The measure for rolling window calculation uses below stepped approach

1. Get filtered table to include all weeks from current week backwards
2. Apply RANKX over table to rank weeks in descending order starting from current week as 1
3. Apply an outer filter to further filter the subset table to only return N weeks (based on slicer value)
4. Apply required aggregation (SUMX,AVERAGEX etc) over the final filtered to get your result over the filtered rolling window

------------------------------------------------------
website: www.dataplatformcentral.com​

Channel URL: https://www.youtube.com/channel/UC0zE...

FB Page:   / data-platform-central-106109457846447