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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
attaalla
New Member

How to make a filter on date dynamic based on a specific start date and a dynamic yesterday

hello, community,

i am stuck in how to change the filter on date column in power query to a dynamic end point.
i connected my source to a website  & i want my report to bring data based on a specific start point & a dynamic yesterday based on local time.

for more simplification:

= Table.SelectRows(#"Reordered Columns", each [Date] >= #date(2023, 1, 1) and [Date] <= #date(2023, 2, 28))

 

i want to change [Date] <= #date(2023, 2, 28) to a dynamic end point refers to yesterday based on my local time.

thanks in advance

1 ACCEPTED SOLUTION

hi @attaalla 

try like:

[Date] <= Date.AddDays(DateTime.Date(DateTime.LocalNow ()),-1)

View solution in original post

4 REPLIES 4
attaalla
New Member

@FreemanZ 

your support is highly appreciated.
 it worked fine now

FreemanZ
Super User
Super User

hi @attaalla 

try like:

[Date] <= Date.AddDays(DateTime.LocalNow (),-1)

@FreemanZ 
thanks for reaching out.
however, there is an issue with the time formating i think.

error.jpg

hi @attaalla 

try like:

[Date] <= Date.AddDays(DateTime.Date(DateTime.LocalNow ()),-1)

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.