Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How can I do a ' not in' in Power Query - New User

Hello,      I am a new Power Query user. I a list of users in a list titled HomeOffice. I have a table of information for my SalesTeam. Some of our SalesTeam members are also in the HomeOffice list...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Indeed, it's the same concept.  If you have TableA, with columns Name, Column2, and Column3, and another table, TableB, with columns Names and Departments.  Any column in any table can be referred to as a list using the Table[ColumnName] syntax.  So:

     

    Table.SelectRows(TableA, each not List.Contains(TableB[Names], [Name]))

     

    TableB[Names] is the column from the other table that you are referring to as a list, and [Name] is the column in your current table that you are turning into a list to compare to the first list.

     

    Very useful!--Nate  P.S. Please mark these as the answer.  Thanks!

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hello,

     

       I change the #ASB Home Office" source back to a table. I went into the advanced editor and tried the following:

     

    #"Filter2" = Table.SelectRows(#"Changed Type1", each not Table.Contains(#"ASB Home Office"[group.member.displayName],[group.member.displayName]))

     

    and I get the error:

     

    Expression.Error: We cannot convert a value of type List to type Table.

     

    I seem to have a data-type mismatch in that line of code.