Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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]...
  • v-lili6-msft's avatar
    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