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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

calculate time in hours extending to multiple days

Hi,

 

Am preparing a dashboard based on airline departure and arrival details, the issue am facing is some airlines depart from say  Washington DC  and arrives at Malaysia  after 2+ days of journey which includes layover also.  How can we calculate the total journey time 

 

( eg: Lufthansa flight departs from Washington Dulles Airport at 09:50 pm on 01st March 2022 and reaches Frankfurt after 8 hours of flight on 02nd March 2022 at 10:00 am.  After a  layover of 5 hours at Frankfurt airport fligth departs at 03:00 pm  and arrives at Malaysia after  12 hours flight at 05:30 am local time. ) 

 

 

Request your guidance 

 

regards,

 

dsmitha

 

1 ACCEPTED SOLUTION

You can check this link below, and please keep in mind that you need the time zone in your dataset :

https://www.enjoysharepoint.com/power-bi-date-format/#:~:text=Power%20bi%20date%20format%20dd%2Fmm%2....

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi amirabedhiafi ,

This is how my input model looks like

dsmitha_3-1650220860956.png

dsmitha_4-1650220920656.png

I would like to add a column which will display the total duration of flight ( including layover time )

 

 

The format of the departure and arrival date may cause you issues.

Even if it can be formatted in DAX (using a complex formula), I suggest you to update it to the right format in the source.

Otherwise, what is the formula that calculate the duration?

Also in the time zone is missing in your case, are you willing to include it ?

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini
Anonymous
Not applicable

hi amirabedhiafi,

am ok to change the departure and arrival date format, which format will be better in this case - request your advise 

 

formula for calculating duration :

( ARRIVAL TIME AT TRANSIT AIRPORT  -  DEPARTURE TIME AT ORIGINA AIRPORT) +(LAYOVER TIME AT TRANSIT AIRPORT) + (ARRIVAL TIME AT DESTINATION AIRPORT - DEPARTURE TIME AT TRANSIT AIRPORT ) 

 

Yes, i missed out time zone, will include it

 

 

 

You can check this link below, and please keep in mind that you need the time zone in your dataset :

https://www.enjoysharepoint.com/power-bi-date-format/#:~:text=Power%20bi%20date%20format%20dd%2Fmm%2....

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini
Anonymous
Not applicable

Thank you for sharing the link, it helped

sure, timezone will be included

 

amirabedhiafi
Impactful Individual
Impactful Individual

Can you please share your model? the input and the expected output ?

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.