Forum Discussion

PowerBIData's avatar
PowerBIData
Frequent Visitor
5 years ago
Solved

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

  • Anonymous's avatar
    Anonymous
    5 years ago

    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")

    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.

4 Replies

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft 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

     

  • 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 )




  • Anonymous's avatar
    Anonymous
    Not applicable

    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")

    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.