Forum Discussion
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
- Sajid02
Helper I
amitchandak onurbmiguel_ Greg_Deckler
Any solution ?- onurbmiguel_
Power Participant
Hello Sajid02
The value ODI SSC actual is in hours?
Example, the value 2.00 is 02:00:00 ?
Can you share a pbix with some dummy values?
Best regards
Bruno Costa | Solution Supplier
Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! π
Take a look at the blog: PBI Portugal
- Sajid02
Helper I
Hi onurbmiguel_
The Value is in the form of seconds like
0.35 is 35 seconds
1.25 is 1 minute and 25 seconds and so on
- Greg_Deckler
Community Champion
- Sajid02
Helper I
Both of the articles are not working in my case
- ppm1
Solution Sage
No need to break it down into hours, minutes, seconds. Please try the approach in this article.
Calculate and Format Durations in DAX β Hoosier BI
Pat