Forum Discussion

Sajid02's avatar
Sajid02
Icon for Helper I rankHelper I
3 years ago

Converting Decimal time to Time format HH:MM:SS

Hi Folk , 

 

Got stuck in one place wherein i want to convert decimal time values into correct time format like HH:MM:SS

Please find below snip :-



Dax I have tried is :- 

ODI SSC Actual_New 1 =

VAR _TPHnPT =
DIVIDE(
SUM('PBIUSER MAX_WORKORDER'[Property Events Seconds]),
[SSC_Total_Props],
0
)


VAR Duration = _TPHnPT
VAR hours = ROUNDDOWN ( _TPHnPT / 3600, 0 )
VAR minutes = ROUNDDOWN ( MOD ( _TPHnPT, 3600 ) / 60, 0 )
VAR seconds = INT ( MOD ( _TPHnPT, 60 ) )

Return
RIGHT("0" & Hours,2) & ":" & RIGHT("0" & Minutes , 2 ) & ":" & RIGHT("0" & Seconds , 2)



Also , by writing this code , i am facing a new problem with calendar slicers as well , as years are not getting showing correct in table with slicer selection.

Code is not working for me here .

How to solve this ?

Thanks in advance for  the help .

12 Replies