DAX for matching string and calculate TAT

Hello all,

A bit complex requirement which I am not able to resolve:

Basis UI path automation I would be getting data of emails from different folders in a table. An email will have multiple occurrences but with appended subject like ‘Re’, ‘FW’, "Re:Re:’ etc as people would reply to an email that is in the inbox. I need to calculate:

  1. Turnaround time of an email which essentially means if there are 2 emails of the same subject( subject would be appended with Re, FW etc in case of replies and forwards), TAT would be timestamp of last instance minus first instance.

  2. Ageing - If there is only 1 instance then now minus timestamp is ageing.

Below is the table with multiple occurence of the email and timestamp associated.

Please let me know in case anybody needs any further explanation or if its not clear.

Subject Received Time
PREM | Power BI Premium | Having problems with SharePoint list. When trying connect to SharePoint list through Power BI desktop, he’s getting an error. 12/26/2018 23:00
RE: PREM | Power BI Premium | Having problems with SharePoint list. When trying connect to SharePoint list through Power BI desktop, he’s getting an error. 12/26/2018 22:54
Re: Q4 Failure 12/24/2018 15:08
RE: PREM | Power BI Premium | Having problems with SharePoint list. When trying connect to SharePoint list through Power BI desktop, he’s getting an error. 12/24/2018 14:42
FW: Q4 Failure 12/24/2018 14:07
RE: License key information 12/24/2018 10:44
RE: License key information 12/24/2018 10:12

Ok, thanks for the information, but I really have no idea what solution is required here. There is a bit going on, I hope you can appreciate.

If you can add a demo model of the situation then this is what will likely get you the best help the fastest.

See below for more tips on asking the most optimal questions.

Thanks
Sam