Forum Discussion

srpeters's avatar
srpeters
Helper II
2 years ago
Solved

Use Different Tables Data In a DAX Column

Hello,

 

I have three different tables with three different amounts. Two of these tables have different keys and the third table has both of these keys. I also have a fourth table with one of the keys and a description of what it correlates to. Here is some sample data:

Table 1:

Table 2:

Table 3:

Table 4:

As you can see I am getting an error message when trying to use DAX to subtract the three different tables amounts from each other in Table 3s DAX Column.

 

Below is the same DAX but as a measure:

 

Is it possible to replicate this measure for each row as a column in a table rather than a measure?

 

Thank you in advance!

  • srpeters Actually in looking at this closer, I believe the issue is that you are using RELATED to reference the same table that you are in, Table3. When creating a calculated column in Table3 that uses a column in Table3, just reference the column, [Column], you do not need to use RELATED and it actually won't work anyway and you will get the error you are receiving.

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    srpeters You can use MAXX(FILTER(...), ...) or LOOKUPVALUE to return data in other tables when no relationship exists.

    • srpeters's avatar
      srpeters
      Helper II

      Since I do have a relationship between these tables through the keys, shouldnt RELATED work? 

       

      My relationships:

       

      If not, then how would you format the LOOKUPVALUE for 3 different tables?

       

      Thank you!

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        srpeters Actually in looking at this closer, I believe the issue is that you are using RELATED to reference the same table that you are in, Table3. When creating a calculated column in Table3 that uses a column in Table3, just reference the column, [Column], you do not need to use RELATED and it actually won't work anyway and you will get the error you are receiving.