Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Latest N Week(s) - Dynamic Selection

I deal with data sets that are delivered weekly which is the lowest granularity. Each file is delieverd on a Sunday. I am tring to find the best way to allow my stakeholder to select a given aggregation of weeks. In the example file there are 4 unique weeks of data.

I have successfully completed this by using a disconnected table but I can't help but feel there is a more effectice/efficent way of doin this.

Sales:=SUM( [Dollar Sales])
Selected Sales:=CALCULATE( [Sales] , FILTER( 'time' , 'time'[Index] <= [Latest N Week(s)] ) )
Latest N Week(s):=MAX([Periods])

Relationships - data[time] to time[time]

 

Example File

1 Reply