Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Tinu
Frequent Visitor

Calculate how long it took to reply to email on my side

I need to calculate how much time passed between an email received and sending out an answer.

 

- This is based on the exchange online standard connector for the mail table

- each email conversation has a unique index "ConversationIndexGUID" (this is previously calcluated as = Table.AddColumn(#"Changed Type", "ConversationIndexGUID", each Text.Middle([Attributes.ConversationIndex],6,16)))

- each conversation can consist of 1 to many back and forth emails. 

- Sent email is defined as AllRows.FolderPath = "\Gesendete Elemente\"

- Received email is defined as AllRows.FolderPath = "\Posteingang\"

- The column AllRows.DateTimeSent is used to calculate the time

 

I am struggeling to calculate for each "Sent Email" what is the time difference to the nearest, earlier "Received Email" (if existing) of the same conversation ID.

 

 Not sure if DAX / M-Query is better. Final email box will be about 500k messages strong.

 

Your help is greatly appreciated. Thanks!

 

MailData.JPG

 

Here a few lines as CSV / Table. (not sure how I can share csv here)

 

AllRows.Folder PathAllRows.DateTimeSentConversationIndexGUID
\Posteingang\05.12.2022 22:093mRZb5LVrksEu4AK
\Posteingang\05.12.2022 15:14R6GinqFR1MTTqUu6
\Gesendete Elemente\05.12.2022 15:11R6GinqFR1MTTqUu6
\Posteingang\05.12.2022 15:01R6GinqFR1MTTqUu6
\Posteingang\05.12.2022 10:14oJNDNtUKvq4kGsdH
\Posteingang\05.12.2022 08:557yTKYcNW//C0GAY5
\Posteingang\05.12.2022 03:24C76rsaFyw0VEuDmm
\Gesendete Elemente\04.12.2022 21:21kkcSZJi3i9TmS7b0
\Posteingang\04.12.2022 21:19kkcSZJi3i9TmS7b0
\Posteingang\04.12.2022 20:58rEZPakDzuwDUydqi
\Posteingang\04.12.2022 20:58rEvGLwKxox2UO3Vy
\Posteingang\04.12.2022 07:39sovAe/8YCOtEuzlw
\Posteingang\04.12.2022 03:30ht1Gm/SGuUVki3HT
\Posteingang\04.12.2022 02:45IjRfhZa5J9ck6tyT
\Gesendete Elemente\03.12.2022 16:40/AFWM5lJ6MTQa6yc
\Gesendete Elemente\02.12.2022 16:46SZkXIk9J4xM0WXpK
\Posteingang\02.12.2022 16:44SZkXIk9J4xM0WXpK
\Posteingang\02.12.2022 16:16EH/oCwDE7JdEGXi4
\Gesendete Elemente\02.12.2022 16:16EH/oCwDE7JdEGXi4
\Posteingang\02.12.2022 16:16EG3JVhQVNMvkWh8v
\Gesendete Elemente\02.12.2022 16:16EG3JVhQVNMvkWh8v
\Gesendete Elemente\02.12.2022 15:57vHo5izMBDdR5+DWt
\Gesendete Elemente\02.12.2022 15:51vu7Vby3CawRG+q+k
\Gesendete Elemente\02.12.2022 15:41kkcSZJi3i9TmS7b0
\Gesendete Elemente\02.12.2022 15:34B0hLT2Dcy6QhCUce
\Gesendete Elemente\02.12.2022 15:33R6GinqFR1MTTqUu6
\Posteingang\02.12.2022 15:11vHo5izMBDdR5+DWt
\Posteingang\02.12.2022 15:03j/KdJe8bZR3Uu6en
\Posteingang\02.12.2022 14:43g722+fE/fTTrSkVe
\Gesendete Elemente\02.12.2022 13:51vHo5izMBDdR5+DWt
\Gesendete Elemente\02.12.2022 13:47rn0JumZmXrQIWnSx

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1670301552785.png

 

 

How long did it take to reply Calculated Column =
VAR _email = Data[ConversationIndexGUID]
VAR _senttime = Data[AllRows.DateTimeSent]
VAR _receivedemail =
    MAXX (
        FILTER (
            Data,
            Data[ConversationIndexGUID] = _email
                && Data[AllRows.Folder Path] = "\Posteingang\"
                && Data[AllRows.DateTimeSent] < _senttime
        ),
        Data[AllRows.DateTimeSent]
    )
RETURN
    IF (
        Data[AllRows.Folder Path] = "\Gesendete Elemente\",
        DATEDIFF ( _receivedemail, _senttime, MINUTE )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

8 REPLIES 8
Syndicate_Admin
Administrator
Administrator

Where do you get outlook csv from?

Hello @Syndicate_Admin 

 

  1. Get Data>> More>>Online Service>>Microsoft Exchange Online.
  2. Type the mailbox address: A@microsoft.com.
  3. Select the Microsoft account type.
  4. Sign in the A@microsoft.com and enter password.
  5. Then you could see load the data.
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1670301552785.png

 

 

How long did it take to reply Calculated Column =
VAR _email = Data[ConversationIndexGUID]
VAR _senttime = Data[AllRows.DateTimeSent]
VAR _receivedemail =
    MAXX (
        FILTER (
            Data,
            Data[ConversationIndexGUID] = _email
                && Data[AllRows.Folder Path] = "\Posteingang\"
                && Data[AllRows.DateTimeSent] < _senttime
        ),
        Data[AllRows.DateTimeSent]
    )
RETURN
    IF (
        Data[AllRows.Folder Path] = "\Gesendete Elemente\",
        DATEDIFF ( _receivedemail, _senttime, MINUTE )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

@Tinu @Jihwan_Kim  any thoughts?

I tried to expand Attributes to get ConversationIndex, but when I do it shows a "Binary"binary.png

Tinu
Frequent Visitor

For this case you want another create another column: Table.AddColumn(#"Changed Type", "ConversationIndexGUID", each Text.Middle([Attributes.ConversationIndex],6,16))) You can also check out tinu.pbix how it works.

24601
Frequent Visitor

Apologies for the reply a long time since it was posted but how did you decide on the characters between 6-16 being your ID for all the emails in that thread?

I'm trying to find rules to state what I have a strong feeling about. 

Thanks @Tinu , how do you get the 'Attribute.ConversationIndex' column to come up vs. it coming up as Binary?

Hi

 

I had a check with my data and it looks very good. Will check a bit deeper, but I would say this is so far the best solution to measure reply-times in outlook with Power BI! Awesome, thanks!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.