Forum Discussion
Custom Date Slicer
- 4 years ago
You can add a column to your date table that calculates the week offset like this.
Week Offset = - INT ( DIVIDE ( TODAY () - [Date], 7 ) )That will give us a column that is updated every time the model is refreshed so the days that are marked with week offset 0 to week offset -3 will shift as TODAY() shifts.
Then you set up two bookmarks that change your date slicer only. One is wide open, "Select a date". The other applies a filter to the slicer where the week offset is <= 0 and >= -3.
Then attach the bookmarks to a bookmark navigation button.
I have attached my sample file for you to look at.
You can add a column to your date table that calculates the week offset like this.
Week Offset = - INT ( DIVIDE ( TODAY () - [Date], 7 ) )
That will give us a column that is updated every time the model is refreshed so the days that are marked with week offset 0 to week offset -3 will shift as TODAY() shifts.
Then you set up two bookmarks that change your date slicer only. One is wide open, "Select a date". The other applies a filter to the slicer where the week offset is <= 0 and >= -3.
Then attach the bookmarks to a bookmark navigation button.
I have attached my sample file for you to look at.
- MP-iCONN4 years agoResolver I
Bookmarks is a great option and you helped me learn about them since this is the first time using them. However in this particular instance I need the 4 Weeks Prior dates to just be 12/23/2021 and not 12/23/2021 - Today. So just 12/23/2021 - 12/23/2021. I like having your option in my toolbox though so thank you for that.