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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Duration between two dates multiple rows

 

Hi all, I wonder if someone can please assist.

 

I have ship visits, and I'm trying to calculate the hours difference between when a ship arrives at anchor (MoveType = Arrive at Anchor) and is assigned a berth (MoveType = Arrival). So I'm wanting to create a separate table viz that rolls up to show one Duration for each visit to measure how long the ship spent at Anchor (the first date when MoveType = Arrive at Anchor) until it was assigned a berth (the last date when MoveType = Arrival)

 

A few notes:

- Each ship has a unique VisitId.

- There are other MoveTypes, but I only want these two to be included in the calculation.

- I have active date and cargo type filters used on the page

 

Here is what the table viz looks like as is:

 

 

arrival date diff.PNG

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Anonymous ,

 

You may refer to the following post.

https://community.powerbi.com/t5/Desktop/Date-difference-When-two-dates-in-different-rows-and-columns/m-p/318893#M141881

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous ,

 

You may refer to the following post.

https://community.powerbi.com/t5/Desktop/Date-difference-When-two-dates-in-different-rows-and-columns/m-p/318893#M141881

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you so much! Perfect. Amended it to fit an existing column that contains an Id field (VisitId), and it works perfectly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.