Expression To Change Specific Date Based On Built In Date Filter

kraamerica

Board Regular
Joined
Apr 7, 2020
Messages
66
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
If the following:

= Table.SelectRows(#"Changed Type", each [BOOK_DT] = #date(2025, 3, 19) or Date.IsInPreviousNDays([BOOK_DT], 1))

I'm trying to change the specific date listed as the actual date 2025, 3, 19 to show today and previous day but I can't write this correctly. Searches turn up how to write it as if I only want to have the expression just showing as today's date. So it needs to be overwritten with this?: <= Date.From(DateTime.LocalNow())) but I keep getting an error.

OR is there a way to filter the query date filter editor to just show today and previous day?

Thanks in advance.
 
You can filter based on a date being today or yesterday, that would be

Power Query:
= Table.SelectRows(#"Changed Type", each ([BOOK_DT] = Date.From(DateTime.LocalNow()) or [BOOK_DT] = Date.AddDays(Date.From(DateTime.LocalNow()), -1)))
 
Upvote 0
Solution
You can filter based on a date being today or yesterday, that would be

Power Query:
= Table.SelectRows(#"Changed Type", each ([BOOK_DT] = Date.From(DateTime.LocalNow()) or [BOOK_DT] = Date.AddDays(Date.From(DateTime.LocalNow()), -1)))
THANK YOU!
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top