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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
estake
Frequent Visitor

Similar equation producing error message in one column

I am calculating the amount of time to close a case during business hours which is a dynamic number based on the group.  I am using a similar function to do so while only changing the open date and closed date for the two equations but receive an error message with the second equation.  

 

*FirstDayEndTime =
DATE ( YEAR ('Case'[CreatedDate]), MONTH ('Case'[CreatedDate]), DAY ('Case'[CreatedDate]))
& " " & TIME(HOUR(Case[BusHrEnd]), MINUTE(Case[BusHrEnd]), SECOND(Case[BusHrEnd]))
 
This equation works perfectly in combining the date and hour closed together. 
 
*LastDayEndTime =
DATE ( YEAR ('Case'[ClosedDate]), MONTH ('Case'[ClosedDate]), DAY ('Case'[ClosedDate]))
& " " & TIME(HOUR(Case[BusHrEnd]), MINUTE(Case[BusHrEnd]), SECOND(Case[BusHrEnd]))
 
This equation produces the follow error message:
 
Cannot convert value '' of type Text to type Date.
 
Does anyone have any suggestions?  All columns are formated the same. 
1 ACCEPTED SOLUTION
tarunsingla
Solution Sage
Solution Sage

Your second formula breaks probably because of null or blank values in the ClosedDate field. You may want to add a check using IF condition in your formula if that is the case.

e.g. 

LastDayEndTime = IF(ISBLANK('Table'[Date]), BLANK(), 'Table'[Date] + 'Table'[Time])

 

Regards,

Tarun
Did I answer your question? Mark my post as a solution!

 

View solution in original post

2 REPLIES 2
tarunsingla
Solution Sage
Solution Sage

Your second formula breaks probably because of null or blank values in the ClosedDate field. You may want to add a check using IF condition in your formula if that is the case.

e.g. 

LastDayEndTime = IF(ISBLANK('Table'[Date]), BLANK(), 'Table'[Date] + 'Table'[Time])

 

Regards,

Tarun
Did I answer your question? Mark my post as a solution!

 

That did the trick, thank you Tarun

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.