Forum Discussion
Lookup values from multiple tables
- Anonymous6 years ago
Greg_Deckler Thanks for your suggestion. However, the full data model is pretty big and I'd like to avoid any bi-directional relationships. I was thinking of a formula like :
Lookup Column = SWITCH(TRUE(),LOOKUPVALUE(Table1[Code],Tabel1[Count],Tabel3[Count])>1,LOOKUPVALUE(Table1[Code],Tabel1[Count],Tabel3[Count]),LOOKUPVALUE(Table2[Code],Tabel2[Count],Tabel3[Count])>1,LOOKUPVALUE(Table2[Code],Tabel2[Count],Tabel3[Count]),LOOKUPVALUE(Table4[Code],Tabel4[Order],Tabel3[Order])>1,LOOKUPVALUE(Table4[Code],Tabel4[Order],Tabel3[Order]),BLANK())It seems that it works fine, but I'm not sure if I'm taking into account all possible implications....
For your testing:
Table1Count Code 1 1234 2 1235 3 1236 Table 2
Count Code Date 2 1237 9/11/2020 5 1238 9/12/2020 6 1239 9/13/2020
Table 3Order Count user name Gender 1 2 432 AA M 2 4 433 AB F 3 5 434 AC M
Table 4
Thanks.Order Code Date status 1 1239 9/13/2020 Completed 2 1240 9/15/2020 Completed 4 1241 9/16/2020 Completed
Anonymous - To ammend this, maybe try changing your relationship direction to both on Table1 and Table3? So, thinking in your Table:
Table3[OrderID]
Table3[Count]
Table1[Code]
This should work without any calculations if you change that relationship direction to Both
- Anonymous6 years agoNot applicable
Greg_Deckler Thanks for your suggestion. However, the full data model is pretty big and I'd like to avoid any bi-directional relationships. I was thinking of a formula like :
Lookup Column = SWITCH(TRUE(),LOOKUPVALUE(Table1[Code],Tabel1[Count],Tabel3[Count])>1,LOOKUPVALUE(Table1[Code],Tabel1[Count],Tabel3[Count]),LOOKUPVALUE(Table2[Code],Tabel2[Count],Tabel3[Count])>1,LOOKUPVALUE(Table2[Code],Tabel2[Count],Tabel3[Count]),LOOKUPVALUE(Table4[Code],Tabel4[Order],Tabel3[Order])>1,LOOKUPVALUE(Table4[Code],Tabel4[Order],Tabel3[Order]),BLANK())It seems that it works fine, but I'm not sure if I'm taking into account all possible implications....
For your testing:
Table1Count Code 1 1234 2 1235 3 1236 Table 2
Count Code Date 2 1237 9/11/2020 5 1238 9/12/2020 6 1239 9/13/2020
Table 3Order Count user name Gender 1 2 432 AA M 2 4 433 AB F 3 5 434 AC M
Table 4
Thanks.Order Code Date status 1 1239 9/13/2020 Completed 2 1240 9/15/2020 Completed 4 1241 9/16/2020 Completed - Greg_Deckler6 years ago
Community Champion
Anonymous You could use LOOKUPVALUE. How are your Table1 and Table3 related? What columns? And is it
Table1 1->* Table3
?
- Anonymous6 years agoNot applicable
Greg_Deckler Table 1 is related to Table 3 as One to Many by Count columns. Thanks.