Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Average after measurement for processing time

Hello to all. I have a report with alerts. They are processed by operators like an incident ticket for example.
For each of them I have a start and end date. To calculate their processing time from start to finish I used this measurement.

I am French so the measurement is in French

Total time = 

Result = Day:Hours:Minuts:SEC

However, I don't know how to calculate an average processing time compared to this measurement. Can you help me ? Thank you

 

Charly

  • Hi Anonymous ,

    You can use datediff() function to get the day, hours, minutes, seconds directly.

    Average time may like this(use format() function to exact decimal point):

    average time = 
    VAR _day =
        FORMAT (
            AVERAGEX ( 'Table', DATEDIFF ( 'Table'[Start date], 'Table'[End date], DAY ) ),
            ".##"
        )
    VAR _hour =
        FORMAT (
            AVERAGEX ( 'Table', DATEDIFF ( 'Table'[Start date], 'Table'[End date], HOUR ) ),
            ".##"
        )
    VAR _minute =
        FORMAT (
            AVERAGEX (
                'Table',
                DATEDIFF ( 'Table'[Start date], 'Table'[End date], MINUTE )
            ),
            ".##"
        )
    VAR _seconds =
        FORMAT (
            AVERAGEX (
                'Table',
                DATEDIFF ( 'Table'[Start date], 'Table'[End date], SECOND )
            ),
            ".##"
        )
    RETURN
        _day & ":" & _hour & ":" & _minute & ":" & _seconds

     

    Best Regards,
    Yingjie Li

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

2 Replies

  • nvprasad's avatar
    nvprasad
    Icon for Solution Sage rankSolution Sage

    Hi,

    I suggest you calculate average time first then (Ex: Divide (TotalTimeTaken, No of Tickets, 0)) use this to derive other variables in the below snapshot.

     

     

    Appreciate a Kudos! 🙂
    If this helps and resolves the issue, please mark it as a Solution! 🙂

    Regards,
    N V Durga Prasad

  • v-yingjl's avatar
    v-yingjl
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    You can use datediff() function to get the day, hours, minutes, seconds directly.

    Average time may like this(use format() function to exact decimal point):

    average time = 
    VAR _day =
        FORMAT (
            AVERAGEX ( 'Table', DATEDIFF ( 'Table'[Start date], 'Table'[End date], DAY ) ),
            ".##"
        )
    VAR _hour =
        FORMAT (
            AVERAGEX ( 'Table', DATEDIFF ( 'Table'[Start date], 'Table'[End date], HOUR ) ),
            ".##"
        )
    VAR _minute =
        FORMAT (
            AVERAGEX (
                'Table',
                DATEDIFF ( 'Table'[Start date], 'Table'[End date], MINUTE )
            ),
            ".##"
        )
    VAR _seconds =
        FORMAT (
            AVERAGEX (
                'Table',
                DATEDIFF ( 'Table'[Start date], 'Table'[End date], SECOND )
            ),
            ".##"
        )
    RETURN
        _day & ":" & _hour & ":" & _minute & ":" & _seconds

     

    Best Regards,
    Yingjie Li

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