I want to add days to Date with condition if Value in column Shift = Night, but it gave error under Date.AddDays
IF [Shift] = "Night" then (Date.AddDays ([Date],1)) elce [Date]
Can someone Advice me what is wrong??
Go to Solution.
Hi @inawab ,
Here my result:
And here the code I used:
if [Shift] = "night" then Date.AddDays([Date], 1) else [Date]
Hope this helps 🙂
Proud to be a Super User!
View solution in original post
You have elce instead of else in the formula
@inawab Power Query is picky in its syntax, upper/lower case, spaces, etc. Try this:
if [Shift] = "Night" then Date.AddDays([Date],1) else [Date]
Click here to learn more about the September 2022 updates!
Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.
Watch Session 25 of Ted's Dev Camp.