cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
wayers Member
Member

DAX calculated column or measure, and displaying in table

Hi,

I'm looking for help with creating a specific table based on my data.

My data contains various columns, shown below.

TESTING.PNG

When collecting data we have many experiments, each experiment is given a unique number, in the table above the experiments are represented in the "EXP" column.

 

Each experiment delivers a unique result, in the table above the result is represented in the "RESULT DATA" column.

 

When evaluating the results of an experiment they are typically compared to another experiment. In the table above the comparing experiment is listed as "COMPARE EXP".

 

When reviewing the result data the column "EXP DIFFERENCE" would result in -17 (EXP 1 (51), - EXP 2 (68)).

 

Now the part I need help with, I would like to have the "EXP DIFFERENCE" polulated in the table for each experiment. Is the correct way to handle this with a calculated column or a measure, and can you provide an example DAX of either or both methods?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: DAX calculated column or measure, and displaying in table

Hey,

you can create a calculated column like so:

Diff = 
var thisResult = 'tablename'[Result Data]
var lookupExperiment = 'tablename'[Compare Exp]
var lookupResult = LOOKUPVALUE('tablename'[Result Data] , 'tablename'[Exp] , lookupExperiment )
return
thisResult - lookupResult

Hopefully this is providing what you are looking for.

 

Regards,

Tom

 

 

 

 

 

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
2 REPLIES 2
Super User
Super User

Re: DAX calculated column or measure, and displaying in table

Hey,

you can create a calculated column like so:

Diff = 
var thisResult = 'tablename'[Result Data]
var lookupExperiment = 'tablename'[Compare Exp]
var lookupResult = LOOKUPVALUE('tablename'[Result Data] , 'tablename'[Exp] , lookupExperiment )
return
thisResult - lookupResult

Hopefully this is providing what you are looking for.

 

Regards,

Tom

 

 

 

 

 

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
wayers Member
Member

Re: DAX calculated column or measure, and displaying in table

@TomMartens 

Thanks for the help!!

Exactly what I was looking for.

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 157 members 2,263 guests
Please welcome our newest community members: