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
AlexisOlson
Super User
4 years agoCan you give a few examples? Is the whole number in units of days, hours, minutes, or something else?
Novice_92
4 years agoFrequent Visitor
Hi,
whole number in this case = seconds and require the formula to convert this into hours & minutes.
- AlexisOlson4 years ago
Super 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".