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
Anonymous
Not applicable

Calculating time difference

I have the following table:

Capture.PNG

I want to add a column that calculates the time difference in hours between each consecutive Updated Date column.

How do I do that?

 

 

5 REPLIES 5
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

I revised the previous reply, you can refer to it.

Best Regards,
Community Support Team _ kalyj

v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, heres my solution.

1.Create a calculated column by the rank of UpdatedDate.

RANK = RANKX('Table','Table'[UpdatedDate],,ASC,Dense)

 

2.Calculates the time difference.

vkalyjmsft_0-1635756408293.png

3.You can also use a card visual to display the sum of time difference.

vkalyjmsft_0-1635832393101.png

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Anonymous 

How can the rankvalue be -1??

Anonymous
Not applicable

Hello @Anonymous ,

 

First create the order with RANKX and then you can do datediff where you filter the second time value rankvalue is  -1

Anonymous
Not applicable

Hey @Anonymous 

 

I actually want the Sum of all those differences of consecutive rows in a measure to display in a card visual.

How do I do the same?

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.