Forum Discussion
Problem - Slicer Date (multiple selection) by default last day
Hi everyone!
I’m asking for your help to solve an issue with the date filter in my Power BI Report. Among my filters, I have a date filter (dropdown slicer with multiple selection) that comes from my dimensional table dim_Calendar and is linked to my fact tables through the Run_date field.
What the client requires is that the date displayed in the filter is always the most recent available date, while still allowing the user to select one or more days through the dropdown menu.
Yesterday I set up the filter and scheduled the daily refresh. Today I expected the filter to show August 21st, but instead the date displayed was still August 20th (although when opening the dropdown menu, the August 21st date does appear).
Please note that I have a star schema with two fact tables (Direct Query connection) and five dimension tables (Dual Mode connection).
How can I fix this? I haven’t figured out how to solve the problem yet.
Thanks in advance.
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.
4 Replies
- MFelixSuper User
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.
- Elisa_CostanzaHelper I
Thank you so much 🎉 it works. I would have preferred to see the latest date directly in the format 22/08/2025, but it seems to be the only possible solution for the moment..
Thank you MFelix 😀
- lauriedataResolver I
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.
- MFelixSuper 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.