Forum Discussion
imnotabot01001
4 years agoRegular Visitor
Filter rows by CONTAIN criteria from a list (AND)
Hi- my table needs to be filtered by a list. Text contained in list should be used as an AND criteria (only show rows that contain all texts from list). Help please 😞 my table: Date Product...
- 4 years ago
Download sample Excel file with query
Here's the code:
let Source = Excel.CurrentWorkbook(){[Name="TextTable"]}[Content], Result = Table.AddColumn(Source, "Check", (FindStrings) => List.AllTrue(List.Transform(WordList, each Text.Contains((FindStrings[Product_Name]), _ )))), #"Filtered Rows" = Table.SelectRows(Result, each ([Check] = true)), #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Check"}) in #"Removed Columns"If you want to do further reading/see more examples of this kind of thing check here
Searching for Text Strings in Power Query • My Online Training Hub
regards
Phil
Anonymous
4 years agoNot applicable
You could do this:
Table.SelectRows(#"Added Custom", each Text.Contains(Text.Combine(listA), [Product_Name]))
--Nate