Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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)
Solved! Go to Solution.
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)
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
User | Count |
---|---|
127 | |
72 | |
70 | |
58 | |
53 |
User | Count |
---|---|
192 | |
96 | |
67 | |
64 | |
54 |