Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

DAX Help - CrossFilter and LookUp

Community,

I am trying to return a difference using multiple tables. I need assistance with DAX for a measure that will return the correct result.

I have two tables...

 

Table1 where;

Test Index Number = Populated as a sequential index for that days testing

SeqID = Set of requirements for a test

Run ID = Unique ID for a grouping of SeqID and a difference in the tested parts

Ref ID = A previous or upcoming Run ID to compare data between

 

Table2 where;

Test Index Number = Populated as a sequential index for that days testing (Matches table1)

Data = Data collect

 

Tables and Relationships (tables connected by Test Index Number)

 

 

 

 

 

 

 

 

 

 

In the image below the green column would be what is looked up and the yellow column would be the difference between the two data. The yellow column is what I'm trying to replicate.

 

 

A test PBIX file can be found here.

 

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    As long as the data in the green column is connected via a relationship to Table1/Table2, then the following code should work in a calculated column:

    Difference =
    Table2[Data] - RELATED ( RefData[Ref Data] )

    This uses the RELATED function to get the relevant value from the green column.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Anonymous ,

      I do not have the ref data as a column and am trying to create a measure for it. Any thoughts on how to replicate the ref data with a measure?

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Is the ref data in another table?

        Could you connect the tables by the Test Index Number?