Forum Discussion

raviv's avatar
raviv
Regular Visitor
4 years ago
Solved

Calculate duration

HI    im struggeling in calculating duration , i have an excel file and i need to calculate more than 24h and show let say the average time to task , in HH:MM.   i need at the show in a chart the...
  • v-yanjiang-msft's avatar
    4 years ago

    Hi raviv ,

    According to your description, here's my solution.

    Create a calculated column.

    Column =
    VAR _P =
        FIND ( ":", 'Table'[time it took] )
    VAR _H =
        MID ( 'Table'[time it took], 1, _P - 1 )
    VAR _M =
        MID ( 'Table'[time it took], _P + 1, LEN ( 'Table'[time it took] ) - _P )
    RETURN
        INT ( DIVIDE ( _H, 24 ) ) & "."
            & MOD ( _H, 24 ) & ":" & _M & ":" & _M & ":" & "00"
    

    Get the result.

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

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