Forum Discussion
Novice_92
4 years agoFrequent Visitor
Duration hh:mm
Morning everyone, I'm looking to convert whole number into hh:mm without it converting into d:hh:mm when it exceeds 24hrs via DAX. Any ideas? TIA
Novice_92
4 years agoFrequent Visitor
Hi,
whole number in this case = seconds and require the formula to convert this into hours & minutes.
AlexisOlson
4 years agoSuper User
Try something like this:
Duration (hh:mm:ss) =
VAR _Seconds = Table1[Seconds]
VAR _Hours = INT ( _Seconds / 3600 )
VAR _Remainder = ( _Seconds - _Hours * 3600 ) / 3600 / 24
RETURN
FORMAT ( _Hours, "00:" ) & FORMAT ( _Remainder, "nn:ss" )
You can drop the ":ss" if you just want "hh:mm".