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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

DAX Help

Hi All,

I have two requirement were I have to find difference between Engineer to Customer response and Customer to Engineer response. Example : If the engineer has responded multiple times then we have to take the difference of the latest response against customer response and vice versa.

 

Please find the data table below :

 

TicketIdNameConversationTimeDiff

TicketId

NameConversationTimeDiff
ABCEngineer01-04-2020 17:36 ABCEngineer01-04-2020 17:36 
ABCEngineer01-04-2020 17:43 ABCEngineer01-04-2020 17:43 
ABCCustomer01-04-2020 20:04141ABCCustomer01-04-2020 20:04 
ABCCustomer01-04-2020 20:13 ABCCustomer01-04-2020 20:13 
ABCCustomer01-04-2020 20:13 ABCCustomer01-04-2020 20:13 
ABCEngineer02-04-2020 13:19 ABCEngineer02-04-2020 13:191026
ABCCustomer02-04-2020 16:42203ABCCustomer02-04-2020 16:42 
ABCEngineer02-04-2020 18:54 ABCEngineer02-04-2020 18:54132
ABCCustomer05-04-2020 15:454131ABCCustomer05-04-2020 15:45 
ABCCustomer05-04-2020 15:45 ABCCustomer05-04-2020 15:45 
ABCEngineer07-04-2020 10:49 ABCEngineer07-04-2020 10:492584

 

I have highlighted the required ones and non-highlighted ones are to be ignored.

Reply or ping me for more details and possible solution.

Thanks in advance

4 REPLIES 4
Anonymous
Not applicable

HI @Anonymous,

You can try to use the following measure formula to calculate between nearest different users to get the diff:

measure =
VAR currName =
    SELECTEDVALUE ( Table[Name] )
VAR currDate =
    MAX ( Table[ConversationTime] )
VAR _next =
    CALCULATE (
        MIN ( Table[ConversationTime] ),
        FILTER (
            ALLSELECTED ( Table ),
            [Name] <> currName
                && [ConversationTime] > currDate
        ),
        VALUES ( Table[TicketId] )
    )
RETURN
    DATEDIFF ( currDate, _next, SECOND )

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @Anonymous ,

 

I am not looking for the complete diference between the conversationtime column. I am looking for immediate difference between "Engineer" and "Customer" as well as "Customer" and "Engineer" column.

 

Hope i am clear with requirement.

File.PNG

 

Thanks,

Apurva

 
Anonymous
Not applicable

Hi @Anonymous,

My formula can use to find out the next records which not has the same name as the current name, it should suitable for your requirement.

In addition, did these fields exist in the same table? If this is a case, you only need to replicate it and replace its name field and date fields.

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @Anonymous,

 

Yes i have TicketId, ConversationTime and Name in the same table. Other are custom columns which i have created to provide you my requirement.

 

Thanks & Regards,

Apurva

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors