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
Victor_Z
Frequent Visitor

How to format times values greater than 24h

Hello everybody

 

I know that Power BI don´t accept time greater than 24 hours and I need to use the data type duration in order to handle it and be able to show the values in different charts. 

However I am struggling with it. I have a time column (data is coming from Excel file - custom format of the column [h]:mm:ss)

 

Victor_Z_1-1699369597922.png

 

that when changing the type to duration it gives the following error.

Victor_Z_0-1699369320177.png

 

In the example value, 02/01/1900 5:00:00  ( 53 hours in the excel file) should be converted to 2.05:00:00

What am I missing?    

2 ACCEPTED SOLUTIONS
goncalogeraldes
Super User
Super User

Hi @Victor_Z ,

 

If you need this to be solved on the Power Query side you can try the solution in the sample file that I attach.

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

View solution in original post

7 REPLIES 7
Ahmedx
Super User
Super User

or this variant

Screenshot_1.png

or

Screenshot_3.png

Hi @Ahmedx 

Thanks for your help. The data I am getting when importing in power Query from Excel File is this format, for example 02/01/1900 5:00:00 (as excel start to count dates from 31/12/1989, therefore  instead of 53:00:00 as text format i am getting 02/01/1900 5:00:00) so your solution is missinh hours.

How can I get those "days" missing so I can have the total number of hours correctly?

do you need to remove these lines?
if you don't need to delete, then show an example and the expected result.

goncalogeraldes
Super User
Super User

Hi @Victor_Z ,

 

If you need this to be solved on the Power Query side you can try the solution in the sample file that I attach.

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

Hi @goncalogeraldes 

Thanks for your reply, but finally your proposal is not working in my case. The data that i got from reading the excel file is a date&time format, so I am not getting 53:00:00 as text value per your example, but for 02/01/1900 5:00:00.

Therefore when doing the steps in Power Query i am missing lot of hours ( for this value, 48 hours exactly)date_time format column power query.jpg

 

 

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.