This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
I'm trying to get a total time it takes from the starting time of 1:06:42pm until 7:59:47pm. The answer would be... 6hrs 53 min and 5 secs. Any ideas how to accomplish this?
Solved! Go to Solution.
Hi @BGlost ,
According to my understanding, you want to convert timediff to the format of Hour&Minute&Second,right?
Please try this:
Hour&Min&Sec =
VAR _diff =
DATEDIFF ( MAX ( 'Table'[Start] ), MAX ( 'Table'[End] ), SECOND )
VAR _h =
MOD ( INT ( _diff / ( 60 * 60 ) ), 24 )
VAR _m =
MOD ( INT ( _diff / 60 ), 60 )
VAR _s =
MOD ( _diff, 60 )
RETURN
_h & "hrs " & _m & "mins " & _s & "secs"The final output is shown below:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @BGlost ,
According to my understanding, you want to convert timediff to the format of Hour&Minute&Second,right?
Please try this:
Hour&Min&Sec =
VAR _diff =
DATEDIFF ( MAX ( 'Table'[Start] ), MAX ( 'Table'[End] ), SECOND )
VAR _h =
MOD ( INT ( _diff / ( 60 * 60 ) ), 24 )
VAR _m =
MOD ( INT ( _diff / 60 ), 60 )
VAR _s =
MOD ( _diff, 60 )
RETURN
_h & "hrs " & _m & "mins " & _s & "secs"The final output is shown below:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can use a measure, i feel little faster loading time with this
TimeDiff = CONVERT(SELECTEDVALUE(Table[Date1],0)-SELECTEDVALUE(Table[Date2],0),DATETIME)
and then change the format to time hh:mm:ss
or maybe this post below help you..
https://community.powerbi.com/t5/Desktop/Calculating-day-time-difference/m-p/321189
Cheers
Have you tried using DATEDIFF yet? It's fairly simple to add and allows you to define your start, end and chosen interval (hours, seconds, days, etc).
Knowledge Base: https://docs.microsoft.com/en-us/dax/datediff-function-dax
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 27 | |
| 26 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 45 | |
| 43 | |
| 41 | |
| 21 | |
| 20 |