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
Anonymous
Not applicable

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

Capture.PNG

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

 

Charly

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community 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

average tiem.png

 

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.

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community 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

average tiem.png

 

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.

nvprasad
Solution Sage
Solution 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

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.