Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Taro_Gulat
Regular Visitor

Timestamp Difference

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. 

Taro_Gulat_0-1734361321901.png

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

1 ACCEPTED SOLUTION
Bibiano_Geraldo
Super User
Super User

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:

Bibiano_Geraldo_0-1734364231861.png

 

 

View solution in original post

1 REPLY 1
Bibiano_Geraldo
Super User
Super User

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:

Bibiano_Geraldo_0-1734364231861.png

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.