Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Creating a column that returns True/False based on values from a column in another table

Hello,   So I have 2 tables that look similar to this (but much longer):  Table A FirstName           LastName           ID Jim                              A             12345     John        ...
  • Anonymous's avatar
    Anonymous
    7 years ago

    If you need them as a column you can use this, create a new column with the following DAX

     

    Blue Raspberry = CONTAINS(FILTER(Table_B,Table_A[ID]=Table_B[ID]),Table_B[Preferences] , "Blue Raspberry")
     
    then update the title and reference for each preference:
    Fruit Punch = CONTAINS(FILTER(Table_B,Table_A[ID]=Table_B[ID]),Table_B[Preferences] , "Fruit Punch")
    Orange = CONTAINS(FILTER(Table_B,Table_A[ID]=Table_B[ID]),Table_B[Preferences] , "Orange")
    Vanilla = CONTAINS(FILTER(Table_B,Table_A[ID]=Table_B[ID]),Table_B[Preferences] , "Vanilla")
    Lemon Lime = CONTAINS(FILTER(Table_B,Table_A[ID]=Table_B[ID]),Table_B[Preferences] , "Lemon Lime")
     
     
    If this solves your issue please mark this as your accepted solution and happy coding :)