Forum Discussion
Lookup one value from multiple tables
- 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.
pradeept it was not a bad idea, and definately not something I had considered. But tried implementing it and it worked fine!
I considered expanding it and tried to take in another column to make the table more useful and central for lookups. Unfortunately I did not succeed in importing another column. The columns comes from the same supporting tables and has the same logic as 'availability'.
Can the function be altered to take more columns in still based on the product numbers.
hi nbrandborg I think it may work. I used the below code snippet.
Product_LookupTable =
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.
- nbrandborg5 years agoHelper II
This was super, super helpful! Worked like a charm!
Thank you pradeept !