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
Anonymous
Not applicable

Filter out dates after today's date

I'm trying to remove future dates from my table.

I tried the below m query which errors, saying the operator 'not' cannot be applied to type DateTime:

 

 

= Table.SelectRows(PreviousStep, each not [Received Date] > DateTime.LocalNow())

 

 

Any suggestions? 

1 ACCEPTED SOLUTION
Krutigawale33
Responsive Resident
Responsive Resident

Hello @Anonymous,

Create a column Like this,

TillToday1 = IF([Date]<=TODAY(),1,0)
 and pass this column as filter to page/visual or all pages in which level you would like to filter the date.
and select 1.
 
Krutigawale33_0-1620647136642.png

 

 

View solution in original post

3 REPLIES 3
Krutigawale33
Responsive Resident
Responsive Resident

or you can try below m query to filter the future dates

 

= Table.SelectRows(#"Changed Type", each [Date] <= Date.From(DateTime.LocalNow()))

Krutigawale33
Responsive Resident
Responsive Resident

Hello @Anonymous,

Create a column Like this,

TillToday1 = IF([Date]<=TODAY(),1,0)
 and pass this column as filter to page/visual or all pages in which level you would like to filter the date.
and select 1.
 
Krutigawale33_0-1620647136642.png

 

 

Anonymous
Not applicable

= Table.SelectRows(Kept24months, each not ([Received Date] > DateTime.LocalNow()))
or
= Table.SelectRows(Kept24months, each [Received Date] <= DateTime.LocalNow())

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.