The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I am having difficulty in calculating the difference between two timestamp when start and end days are different. For the same day it is working.
In above case i need to calculate time difference between start and end for each step. The result should be in HH:MM:SS format.
Can anyone help?
Thanks
Solved! Go to Solution.
Hi @Taro_Gulat ,
Create a new calculated column in your table using this DAX:
TimeDifference =
VAR TotalSeconds = DATEDIFF('Table'[Start], 'Table'[End], SECOND)
VAR Hours = INT(TotalSeconds / 3600)
VAR Minutes = INT(MOD(TotalSeconds, 3600) / 60)
VAR Seconds = MOD(TotalSeconds, 60)
RETURN
FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00") & ":" & FORMAT(Seconds, "00")
Your final result will look like this:
Hi @Taro_Gulat ,
Create a new calculated column in your table using this DAX:
TimeDifference =
VAR TotalSeconds = DATEDIFF('Table'[Start], 'Table'[End], SECOND)
VAR Hours = INT(TotalSeconds / 3600)
VAR Minutes = INT(MOD(TotalSeconds, 3600) / 60)
VAR Seconds = MOD(TotalSeconds, 60)
RETURN
FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00") & ":" & FORMAT(Seconds, "00")
Your final result will look like this:
User | Count |
---|---|
75 | |
70 | |
39 | |
30 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
48 | |
46 |