Power Query If Statements with Dates

cmcreynolds

Active Member
Joined
May 21, 2015
Messages
295
I'm trying to use an If statement in the (Power) Query Editor that includes a date, but it's not recognizing my syntax:

if [Close Date]=6/29/2015 then Date.AddDays([Close Date], 2) else [Close Date])

(Trying to have everything that is the date 6/29/2015 to be 7/1/2015)

I've tried 6/29/2015 and "6/29/2015" - am I missing how to do this?

Thanks!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi,
Instead of #date(2015,06,29) you can use Date.FromText("6/29/15", "en-US") or Date.From("6/29/15", "en-US")

Regards
 
Upvote 0

Forum statistics

Threads
1,224,118
Messages
6,176,483
Members
452,730
Latest member
palsmith

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