Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Everyone
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??
Solved! 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 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
| Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
| Also happily accepting Kudos 🙂 |
| Feel free to connect with me on LinkedIn! | |
| #proudtobeasuperuser | |
Hi @inawab ,
Here my result:
And here the code I used:
if [Shift] = "night" then Date.AddDays([Date], 1) else [Date]
Hope this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
| Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
| Also happily accepting Kudos 🙂 |
| Feel free to connect with me on LinkedIn! | |
| #proudtobeasuperuser | |
@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]
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!