Forum Discussion
Default date range in date slicer
Hi,
I have a date slicer on my report. I want to add default date range like last 45 days on my slicer. So when the reports open for the first time it should dispaly last 45days date range. But When I click on the slicer, I should be able to select whatever dates are available in my calendar (e.g. from 2018 to today).
As of now I have added filter on my slicer but that makes other dates in disabled mode. (see screenshots) Is there any way to have all the dates enabled but default range is last 45 days. (I do not want to use Filter as this is in embedded mode and user cant interact with filters)
Hi Kandarp ,
Currently, there is no such function to set a default value for the slicer. But you can achieve this goal through the following methods.
1.Create a seperate table by entering data.
Here I use the exclamation mark to make him the first place in the slicer. The slicer is set to single selection.
2. Then the measure can be created like
Measure = IF(SELECTEDVALUE('Table (3)'[default value])="!previous 45 days",CALCULATE(SUM('Main table'[Value]),FILTER('Calendar',[Date]<=TODAY()&&[Date]>=TODAY()-44)),SUM('Main table'[Value]))In this way, every time you open the report, the default is the data of the previous 45 days. If you want to filter, select all from the single-choice slicer and filter the date range.
And similar question refer:
https://www.youtube.com/watch?v=KBEsPGxDxHM&feature=youtu.be
https://forum.enterprisedna.co/t/how-to-default-last-12-months-in-date-between-slicer/18697/17
Best Regards
Lucien