Forum Discussion
Anonymous
7 years agoNot applicable
Switch function result error
Hello, Please see below and provide your suggestions,I have used below formula but I am not getting correct result. Comments = SWITCH(TRUE(),
'Table2'[Seller]=RELATED(Table1[Joint Venture]...
- 7 years ago
HI, Anonymous
You can't use RELATED Function in your case,
If you create a relationship between table1 and table2
Only first and second row of table2 could have the related data in table1
So it will due to the problem.
Try this formula
Comments = SWITCH(TRUE(), 'Table2'[Seller]=LOOKUPVALUE(Table1[Joint Venture],Table1[Joint Venture],Table2[Seller]),"Joint Venture", 'Table2'[Country]=LOOKUPVALUE(Table1[Country],Table1[Country],Table2[Country]),"Dealer", 'Table2'[Seller]=LOOKUPVALUE(Table1[Sub Dealer],Table1[Sub Dealer],Table2[Seller]),"sub dealer", "deal")Result:
Best Regards,
Lin
v-lili6-msft
Community Support
7 years agoHI, Anonymous
You can't use RELATED Function in your case,
If you create a relationship between table1 and table2
Only first and second row of table2 could have the related data in table1
So it will due to the problem.
Try this formula
Comments = SWITCH(TRUE(),
'Table2'[Seller]=LOOKUPVALUE(Table1[Joint Venture],Table1[Joint Venture],Table2[Seller]),"Joint Venture",
'Table2'[Country]=LOOKUPVALUE(Table1[Country],Table1[Country],Table2[Country]),"Dealer",
'Table2'[Seller]=LOOKUPVALUE(Table1[Sub Dealer],Table1[Sub Dealer],Table2[Seller]),"sub dealer",
"deal")
Result:
Best Regards,
Lin
- Anonymous7 years agoNot applicable
Hi Lin,
Thank you so much for unique solutions and for relationship explaniations.