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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
wyanjaspew
Advocate I
Advocate I

Date.AddDays(DateTime.LocalNow(), (-3))

Hi Sirs / M'am,
anyone can help please. thanks

wyanjaspew_0-1680574794077.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

...Date.AddDays(DateTime.LocalNow(), -3))

 

Note that you are using a datetime value to test equality against what appears to be a date column. I would wrap DateTimeLocalNow() with a Date.From, so

 

Date.AddDays(Date.From(DateTime.LocalNow()), -3))

 

--Nate

View solution in original post

3 REPLIES 3
Mekist
Helper III
Helper III

Hello
If the date falls on the weekend, how should I say -2 days out?

Mekist
Helper III
Helper III

Hello

I wanted to take out the day by translating the date into text, can you help

DateTime.ToText(Date.From(Date.AddDays(DateTime.LocalNow(), "dd-MM-yyyy", -3)))

Anonymous
Not applicable

...Date.AddDays(DateTime.LocalNow(), -3))

 

Note that you are using a datetime value to test equality against what appears to be a date column. I would wrap DateTimeLocalNow() with a Date.From, so

 

Date.AddDays(Date.From(DateTime.LocalNow()), -3))

 

--Nate

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.