cancel
Showing results for
Did you mean:
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.

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

## 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
Proud to be a Datanaut!
2 REPLIES 2
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
Proud to be a Datanaut!
Member

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

Thanks for the help!!

Exactly what I was looking for.

Announcements

#### Community Highlights

Find out what's new in the Power BI Community!

#### Power Platform Summit North America

Register by September 5 to save \$200

#### 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.

#### Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 366 members 3,766 guests
Recent signins: