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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vaibhavtandon87
Regular Visitor

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.

 

SubjectReceived 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 Failure12/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 Failure12/24/2018 14:07
RE:  License key information12/24/2018 10:44
RE:  License key information12/24/2018 10:12
3 REPLIES 3
Anonymous
Not applicable

First of all, you should correctly prepare your data for analysis using Power Query, not DAX. What this means is you should analyze your requirements (which measures you need to create and what attributes you want to slice by) and then create all the entities. For instance, you need to have a column that will store the "normalized subject" (without the appended RE: and the likes). You should probably create a table that will store EmailID and then all the varieties of it with the times when they arrived... Only after you have a proper model, you can think about creating performant and SIMLPE measures. In the current state of the model... JUST FORGET IT (unless you want to suffer).

Best
Darek

Best
Darek

Hello Darek,

 

Thanks for the suggestion! Could you please guide me on how to do with the Power query?

 

Regards

Vaibhav

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors