Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Average time between emails

Please advice how to get time from previous email.

I have table bellow:

email_IDcustomerreceived
1alfa1.1.2024 12:00
2alfa1.1.2024 13:00
3beta1.1.2024 13:15
4alfa2.1.2024 08:00
5beta

2.1.2024 10:15

6beta

3.1.2024 07:15


1. How to get the average time to receive emails?
2. How to get the average time to receive emails with active customer slicer? (for example: from alfa only)

Thank you in advance!
Jaroslav

 

  • hello Anonymous 

     

    please check if this accomodate your need.

     

    1. create a new measure for calculating 'Get Time from Previous Email'

    Get Time from Previous Email = 
    var _ID = SELECTEDVALUE('Table'[email_ID])
    Return
    MAXX(
        FILTER(
            ALL('Table'),
            'Table'[email_ID]<_ID
        ),
        'Table'[received]
    )

    2. create a new measure for calculating 'Time Difference' since you want to see the average time

    Time Difference = 
    var _Received = SELECTEDVALUE('Table'[received])
    Return
    DATEDIFF('Table'[Get Time from Previous Email],_Received,MINUTE)

    3. create a new measure for calculating 'Average'

    Average = AVERAGEX('Table',[Time Duration])

    4. to get average time for each customer, create a slicer with customer as the value.

     

    Hope this will help.

    Thank you.

1 Reply

  • Irwan's avatar
    Irwan
    Super User

    hello Anonymous 

     

    please check if this accomodate your need.

     

    1. create a new measure for calculating 'Get Time from Previous Email'

    Get Time from Previous Email = 
    var _ID = SELECTEDVALUE('Table'[email_ID])
    Return
    MAXX(
        FILTER(
            ALL('Table'),
            'Table'[email_ID]<_ID
        ),
        'Table'[received]
    )

    2. create a new measure for calculating 'Time Difference' since you want to see the average time

    Time Difference = 
    var _Received = SELECTEDVALUE('Table'[received])
    Return
    DATEDIFF('Table'[Get Time from Previous Email],_Received,MINUTE)

    3. create a new measure for calculating 'Average'

    Average = AVERAGEX('Table',[Time Duration])

    4. to get average time for each customer, create a slicer with customer as the value.

     

    Hope this will help.

    Thank you.