Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
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_Name |
1/1 | AA BB CC |
1/2 | BB CC XYZ |
1/3 | AABB XYZ |
1/4 | BBCC |
listA (criteria):
AA |
XYZ |
desired result:
Date | Product Name |
1/3 | AABB XYZ |
*I've done a NOT criteria filter based on the below. this acts like an OR , whereas I need an AND
Table.SelectRows(#"Added Custom", each List.Count(Splitter.SplitTextByAnyDelimiter(listA)([Product_Name])) > 1)
Solved! Go to Solution.
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
Proud to be a Super User!
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
Proud to be a Super User!
Hi @PhilipTreacy thanks for this it works!! exactly what I was looking for.
Not essential but, would there be a way to shorten code so there's only one step involved? Thanks again!
No not really. I mean you could move the code into a function and call that in one step but that's overcomplicating things.
You can rearrange the code like so if you want
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"
regards
Phil
Proud to be a Super User!
You could do this:
Table.SelectRows(#"Added Custom", each Text.Contains(Text.Combine(listA), [Product_Name]))
--Nate
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.