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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
YcnanPowerBI
Helper II
Helper II

Adding a day if time = 12:00:00 AM

Morning all - I am running into an issue with a custom column.  I want to add a day to a date field if my time field = 12:00:00 AM but it is not working.  Not sure where I am going wrong here, but hoping it is a simple issue

 

I want to add a day to [Shift date] if [Shift end time.1] = 12:00:00 AM

 

What I am using now that is not working:

if [Shift end time.1] = #duration(0,24,0,0)
then
Date.AddDays([Shift date],1) else [Shift date]

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

if Number.From([Shift end time.1]) = 0
then
Date.AddDays([Shift date],1) else [Shift date]

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

if Number.From([Shift end time.1]) = 0
then
Date.AddDays([Shift date],1) else [Shift date]

It worked, thank you so much!  And wow, I was way off, but thanks to people like you, learning more every day!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.