Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Problem with LOOKUPVALUE not searching multiple columns

Am I right in saying that I cannot use the same Search_ColumnName twice when using the LOOKUPVALUE function?

I have 4 columns in one table with values that match the Search_ColumnName values in another table and I am trying to use the same Search_ColumnName for all 4 Search_Values and its is giving me blanks in the new column. 

Example 1 (This works with the correct values in the new column)

 

Teamowner = LOOKUPVALUE(Owner[Owner],Owner[Team],S3SSL[tags2])

 
Example 2 (This one just gives me blanks in the new column)

Teamowner = LOOKUPVALUE(Owner[Owner],Owner[Team],S3SSL[tags1],Owner[Team],S3SSL[tags2],Owner[Team],[tags3],Owner[Team],S3SSL[tags4])
 
What is the best way to combine the 4 columns in the S3SSL table to one new column using the values in the Owner table?


 

5 Replies

  • If you know that there will only be 1 row which matches then you could use

    Teamowner =
    SELECTCOLUMNS (
        FILTER (
            Owner,
            Owner[Team] IN { S3SSL[tags1], S3SSL[tags2], S3SSL[tags3], S3SSL[tags4] }
        ),
        Owner[Owner]
    )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for the reply but unfortunately that didnt work.

       

      This is what I am trying to achieve

       

       

      • johnt75's avatar
        johnt75
        Icon for Super User rankSuper User

        You need to filter out the blanks as well,

        Teamowner =
        SELECTCOLUMNS (
            FILTER (
                Owner,
                Owner[Team]
                    IN { S3SSL[tags1], S3SSL[tags2], S3SSL[tags3], S3SSL[tags4] }
                        && NOT ISBLANK ( Owner[Team] )
            ),
            Owner[Owner]
        )
        
  • Anonymous's avatar
    Anonymous
    Not applicable

    Still no joy on this one so I ended up creating a conditional column, which also gave me errors until I added a character to the blank spaces in each column and then it gave me what I needed. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    The problem is with the final parameter but it gives no expalanation as to what the issue might be.