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.
Greg_Deckler
Community Champion
6 years agoAnonymous - It looks like you are getting back a value that is essentially the decimal portion of a day (24 hours). In DAX, you could get that duration in seconds using the following:
Column = ([Finished] - [Started]) * 1. * 24 * 60 * 60
So, Finished - Started and you multiply by 1. to get a decimal value. You then multiply this by 24 to get the number of hours, 60 to get the number of minutes and then 60 again to get the number of seconds.