Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
michaelu1
Helper II
Helper II

Date filter not working correctly

The issue I was trying to resolve was how can I have a date filter that defualts to today while giving users the option to select other dates.

 

I came up with a solution by adding a text column to my date table that returned "Today" for TODAY() and a text number of the day of month if not:   Day/Today = IF('Date'[Date] = TODAY (), "Today", DAY('Date'[Date]) &"") 

I nested that inside the year and month, and then selected "today" so that it defualts there. This then gives users the option to select another day while keeping the default view to today.

 

The issue that I'm running into is that when the new month starts the Today selection is somehow still stuck inside the prior month, even though it no longer exists there.

 

michaelu1_0-1683230497575.png

 

The circled red should have been selected, instead there is a non-existant Today under April.

 

See PBIX File 

4 REPLIES 4
Fatema123
Frequent Visitor

Hi @michaelu1 ,

 

Problem which I understood is you want to limit your date till today so you can insert the new step in the Power Query editor as below :

Table.SelectRows(Datetablename, each [Datecolumnname] <= Date.From(DateTime.LocalNow()))

If I answered your question Mark my post as a solution!

I don't see how this is relevent.

 

I'm trying to allow end users the option to select any date, while also defaulting the filter to today.

vicky_
Super User
Super User

The reason that there are multiple Todays is because each month will have a day which is the same as todays (e.g. 05/05/2023 and 05/04/2023 will both show as today becase the dd part of dd/mm/yyyy is the same)

If you need to default to today's date, then you can consider using a relative date filter.

I don't beleive that is correct, look at the DAX, "today" only shows up once on the column. And, if you look at the screenshot you'll see that the April "Today" doesn't show up at the same day, it shows up at the end, and this only happens at months end..

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.