Forum Discussion
Anonymous
6 years agoNot applicable
Changing decimal number into Duration
I have a table with a Start and Finish time I have created a calculated column which subtracts Finish time from start time to give me a duration. The issue I'm having is the format in which the Durat...
Anonymous
6 years agoNot applicable
Hi mussaenda,
Thanks for getting back to me! Unfortuantly that didn't work! I got an error where some of the Finished dates return blanks.
I tried to use the Try Otherwise function. But this just returned the "otherwise" value for all rows.
mussaenda
Community Champion
6 years agoHi Anonymous ,
As you can see, I used an If Else for the null then it's okay.
Then in Dax, I transformed it to duration time format which I also found here in the forum.
Core Time_Seconds Measure = SUM('Table'[Core Time_Seconds])
Duration Format Time_Employee Measure =
VAR hours =
ROUNDDOWN ( [Core Time_Seconds Measure] / 3600, 0 )
VAR minutes =
ROUNDDOWN ( MOD ( [Core Time_Seconds Measure] , 3600 ) / 60, 0 )
VAR seconds =
INT ( MOD ( [Core Time_Seconds Measure] , 60 ) )
RETURN
FORMAT(hours,"00")
& ":"
& FORMAT(minutes, "00")
& ":"
& FORMAT(seconds, "00")