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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Keep rows where date is before today

Hi,

 

I want to keep the rows where the value is before today. The filter needs to be dynamic, so the today filter must change to the current date. 

 

This is the column for the filter.

 

Who can help me out?

 

Thanks

 

Rgieltjes_Meyn_0-1686551587918.png

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Anonymous ,

 

If it is in Power Query you can use this code as today's date:

Date.From(DateTime.LocalNow())

In the query editor, filter the column to any date desired and replace the part of the formula which looks like this:

= #date(2023,1,1) //note: do not delete the ) after this.

with

<=Date.From(DateTime.LocalNow())

 

DateTime.LocalNow() is equivalent to NOW() in DAX or Excel. Since we need to get jus the date component, we then wrap it with Date.From()

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @Anonymous ,

 

If it is in Power Query you can use this code as today's date:

Date.From(DateTime.LocalNow())

In the query editor, filter the column to any date desired and replace the part of the formula which looks like this:

= #date(2023,1,1) //note: do not delete the ) after this.

with

<=Date.From(DateTime.LocalNow())

 

DateTime.LocalNow() is equivalent to NOW() in DAX or Excel. Since we need to get jus the date component, we then wrap it with Date.From()

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Mahesh0016
Super User
Super User

@Anonymous Please Share Your ENDOUTPUT in table!THANK YOU!!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.