Forum Discussion

nbrandborg's avatar
nbrandborg
Helper II
5 years ago
Solved

Lookup one value from multiple tables

Hi all, I'm having a master table containing product numbers in scope from which I want to lookup values in from other sources/tables. The values to one of the columns in the master table needs t...
  • pradeept's avatar
    pradeept
    5 years ago

    hi nbrandborg  I think it may work. I used the below code snippet.

    1. Create loook up table like this.
    Product_LookupTable =
    Union(
    SELECTCOLUMNS(Table1, "Product number", Table1[Product number],"Availability", Table1[Availability],"New_Column",Table1[x]),
    SELECTCOLUMNS(Table2, "Product number", Table2[Product number],"Availability", Table2[Availability],"New_Column",Table2[y])
    )

    2. Create columns in the Product Master table like this.

    Availability =
    LOOKUPVALUE(Product_LookupTable[Availability],Product_LookupTable[Product number],Product_Master[Product number])

    New_Column_Master =
    LOOKUPVALUE(Product_LookupTable[New_Column],Product_LookupTable[Product number],Product_Master[Product number])

    Did I answer your question? Mark my post as a solution! It helps others.