Forum Discussion

TAD80's avatar
TAD80
Frequent Visitor
3 years ago
Solved

DAX query across 3 tables

Hi,    I am looking for hlep please. Apologies if it has been asked already.    I have 3 tables, each with a Product Name column, i have created relationships between them all. I need to look up...
  • DallasBaba's avatar
    3 years ago

    Hi TAD80 can you try this formula

    = IF (
    NOT ( ISBLANK ( LOOKUPVALUE ( Table2[Product Name], Table2[Product Name], [Product Name] ) ) ),
    LOOKUPVALUE ( Table2[Cost Centre], Table2[Product Name], [Product Name] ),
    IF (
    NOT ( ISBLANK ( LOOKUPVALUE ( Table3[Product Name], Table3[Product Name], [Product Name] ) ) ),
    "N/A",
    ""
    )
    )


    The above formula checks if the ‘Product Name’ exists in Table 2. If it does, then it populates the ‘Owner’ column with the corresponding ‘Cost Centre’.
    If it doesn’t exist in Table 2, then it checks if it exists in Table 3.
    If it does, then it populates the ‘Owner’ column with “N/A”.
    If it doesn’t exist in either table, then it leaves the ‘Owner’ column blank.

     

    Please let me know if this work.

     

    Thanks