Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Filter string column with list of strings

Hi guys,   I have a power query list which has a column [Products] containing strings. I want to filter the table with this column by using multiple strings (keywords) that are contained in a...
  • AlB's avatar
    6 years ago

    Hi Anonymous 

    Right now you are returning a function for each row. Drop the first each in your last step (the one in red below)

    #"Added Custom" = Table.AddColumn(#"Promoted Headers", "Check", each (C) => List.AnyTrue(List.Transform(Table4, each Text.Contains(C[Products], _))) )

    By eliminating that each, the step will return the result of the List.AnyTrue( ... ). Do make sure Table4 is actually a list, since you're passing it as first argument fro the List.Transform( )

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers