Forum Discussion

DJH1's avatar
DJH1
New Member
2 years ago
Solved

How to filter a column from items in another dataset column

I have two datasets and I want to filter a column in the first dataset against matching items in a column in the second dataset they are both string columns.  I'm trying to build a visual that will s...
  • jgeddes's avatar
    2 years ago

    You should be able to use List.Contains to filter the table. 
    Consider the example data...
    itemTable

    criteriaTable

    you can select rows from itemTable that are not in the criteriaTable adding this line to itemTable

     

    = Table.SelectRows(PREVIOUSSTEP, each not List.Contains(Table.ToList(crtiteriaTable), [Item]))

     

     


    if you wanted to select rows that matched the criteria, you would remove the 'not' from the above code.
    Hope this gets you pointed in the right direction.