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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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