Forum Discussion
Problem - Slicer Date (multiple selection) by default last day
- 1 year ago
Hi Elisa_Costanza ,
You cannot have this directly, you need to create a new column (using Power Query or DAX calculated column) with the value for the current date saying today so your data on that specific column will look like:
Today8/20/2025
8/19/2025
8/18/2025
...
1/1/2025
Then do a sort of this column by the date column so you have the correct sorting, then use this specific column on your slicer and select the Today value before publishing that will force the value to always be the default one.
The rest will work in the same way.
MFelix Is there a way to have the last two dates be the default choice, not just one? I can't have them combined into a "last 2 days" choice unless I can also have the last two dates as independent choice. That is, the user needs to be able to either choose "last 2 days" or switch the default to one of the last two days and any other day they prefer in the calendar. Thanks in advance.
- MFelix9 months agoSuper User
Hi lauriedata ,
I have done something similar adding two values:
Today
Today - 1
3/11/2025
2/11/2025
1/11/2025
....
1/1/2025
You code should be similar to:
DAX Code = SWITCH(TRUE(), Table[Date] = Today(), "Today", Table[Date] = Today()-1, "Today -1", Table[Date] ) M Code: if [Date] = Date.From (DateTime.LocalNow()) then "Today" else if Duration.Days (Date.From (DateTime.LocalNow()) - [Date]) = 1 then "Today - 1" else [Date]You can replace those values by whatever you see fit the questions is you need to have them selected on the slicer so it get's picked up every single day.