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




!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

Helpful resources

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors