Forum Discussion
Default date range in date slicer
- 3 years ago
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
Hi Kandarp
My client also had this requirement that he needed to last week by default without any bookmark. What we ended up doing was buying a custom visual named Date Picker by Powerviz. It had this feature of default selection built in so made the job easy and the client happy.
if you can see in the above example the max week is selected by default. In your case, you can apply the preset like the last 45 days.
I think you should check them out.
Here is a link if you want to check this visual - https://appsource.microsoft.com/en-us/product/powerbivisuals/truvizinc1674781244292.date-picker-by-p... (I believe they offer a free version too)