Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
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]
| User | Count |
|---|---|
| 12 | |
| 6 | |
| 5 | |
| 5 | |
| 5 |