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

How to add total Time HH:MM

I have a table with traveling data called  Travel Time and I want to add it together,

TravelTime|HH:MM

7.30

2.20

 

The total expected time (HH: MM) is 7.30+2.20=9.50 

 

Thanks in advance

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

Hi @PowerBIData 

You can calculate the sum for the column[TravelTime|HH:MM] ,and then convert the value(Decimal number) to time format .

For example :

Column = FORMAT(TIME(TRUNC('Table'[TravelTime|HH:MM],0),('Table'[TravelTime|HH:MM]-TRUNC('Table'[TravelTime|HH:MM],0))*60,0),"long time")

Ailsamsft_0-1626406905657.png

Best Regards

Community Support Team _ Ailsa Tao

 

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

4 REPLIES 4
v-yetao1-msft
Community Support
Community Support

Hi @PowerBIData 

You can calculate the sum for the column[TravelTime|HH:MM] ,and then convert the value(Decimal number) to time format .

For example :

Column = FORMAT(TIME(TRUNC('Table'[TravelTime|HH:MM],0),('Table'[TravelTime|HH:MM]-TRUNC('Table'[TravelTime|HH:MM],0))*60,0),"long time")

Ailsamsft_0-1626406905657.png

Best Regards

Community Support Team _ Ailsa Tao

 

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

aj1973
Community Champion
Community Champion

Hi @PowerBIData 

I created an example, check it out. 

https://drive.google.com/drive/folders/1a9P05JCCETmep3vMDdVrixXhY-uK4gp-?usp=sharing

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Fowmy
Super User
Super User

@PowerBIData 

If you need to convert it in Power Query: add the following Custom Column and change data type to Time.

#duration( 0, Number.IntegerDivide([Time],1) ,  Number.Mod([Time],1)*60, 0 )




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

mahoneypat
Employee
Employee

The simplest way to do that is to convert your time columns to decimal number, make your expression, and then use a custom format string to display it as hh:mm  (use hh:nn).

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.