Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

how to match partial text from two tables and provide a datediff ?

Hi all,


I have two tables where all emails received/sent are recorded with the following columns/information


What I'd like to do is calculate the time between the email being received and the reply being sent for each email separately in order to see based on each time increment (either yearly, monthly or weekly) how many emails were answered within specific timeframes ...

Can anyone assist with how you could go about to "match" each specific email to its particular answer (there should be only the addition of the prefix "RE:" to the email subject ?

Then, would datediff work to calculate the timeframe elapsed between them?

Frequent Visitor

Sorry, I don't see how this apply here ... so I'll try to explain differently (I hope it's clarifies things a bit)


So what I'm aiming to do is have a search in one excel sheet for the title of email (received) and search in another excel sheet the corresponding email (sent) then get a measure/new column that tells me for each email received how long it took to reply.

Do I need to somehow merge the two excel sheets?

I think one of the issue is that it's not like the email (received) and email (sent) are necessarily on the same row so I need the software to "dig" through all the data to find the correct email (by example the received email would have the name "hello casablanca" and the reply must be "RE:hello casablanca" and differentiate in the case of a chain of email between "RE:hello casablanca" and "RE:RE:hello casablanca" if you see what I mean)

Super User
Super User

@Aymeric_2350 , check if Text filter can help

Text Filter Slicer and how to search on Multiple columns:


or create measures using




Helpful resources

Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors