Power Query Filter by List of Values: 10 Real Methods
In this article
- 1. The Filter Pane's Text Filters
- 2. Keep Rows > Keep Matching Items
- 3. A Manual Filter Step with List.Contains
- 4. List.Contains with Comparer.OrdinalIgnoreCase
- 5. Reference a Query That Holds the List
- 6. Merge Queries as an Inner Join
- 7. Check Membership with List.ContainsAny and List.ContainsAll
- 8. Reverse It with List.Contains (Not)
- 9. Filter with a Text.Contains Pattern List
- 10. Parameterise the List for Reuse
- How to Choose
- Frequently Asked Questions
- Final Thoughts
Filtering a column by a list of values is one of the most common Power Query tasks, and there are several ways to do it. The short version: use Keep Rows > Keep matching items when your list is short and typed by hand, or load the list into its own query and reference it with Table.SelectRows or a merge when it is long, changes over time, or lives on a spreadsheet. This list covers ten concrete approaches, from the right-click filter pane to List.Contains with Comparer.OrdinalIgnoreCase, aimed at anyone who cleans data in Excel or Power BI and wants the filter to survive a refresh.
1. The Filter Pane's Text Filters
Every column header arrow opens a filter menu, and it includes a search box where you can type values or paste them one per line. This is the fastest route for a handful of values and requires no code, but the filter is stored as a list of literals inside the step. That matters when the source gains new rows: a value you did not include is silently dropped. Use it for one-off cleanup, not for repeatable reports.
2. Keep Rows > Keep Matching Items
Select the rows you want first — hold Ctrl to pick multiple cells — then right-click the column header and choose Keep Rows > Keep Rows variants in the context menu, or use Home > Keep Rows. Power Query writes an Table.SelectRows step with an OR chain of equality tests. It is the quickest way to turn an eyeballed selection into an explicit filter, and the resulting M code is easy to read and edit. Labels vary slightly by version and locale, so look for the Keep Rows group on the Home tab.
3. A Manual Filter Step with List.Contains
The most readable hand-written filter is one line of M: Table.SelectRows(Source, each List.Contains({"Open", "Pending", "Escalated"}, [Status])). It replaces a long OR chain with a single list you can edit in place. Add values inside the braces and press Enter. Because M is case-sensitive by default, remember that "open" will not match "Open" — a frequent cause of "my filter is dropping rows".
4. List.Contains with Comparer.OrdinalIgnoreCase
Fix case sensitivity properly by passing a comparer: List.Contains({"open", "pending"}, [Status], Comparer.OrdinalIgnoreCase). This matches regardless of capitalisation, so messy exports with mixed casing still work. Use Comparer.Ordinal for exact binary comparison and Comparer.FromCulture("en-US", true) when culture-specific sorting or casing rules matter. This is the right choice whenever your source data comes from people typing into forms.
5. Reference a Query That Holds the List
Create a separate query — say ValuesList — with a single column of the values you want. Then filter with Table.SelectRows(Source, each List.Contains(ValuesList[Column1], [CustomerID])). The list is now editable in Excel, needs no code changes, and refreshes with the workbook. Point the list query at a table on a worksheet or a SharePoint list and business users can maintain it themselves. Keep the column type identical to the source column — text versus number mismatches produce zero matches.
6. Merge Queries as an Inner Join
Instead of filtering, merge your data query with the list query and choose Inner join kind in the Merge dialog. Only rows present in both tables survive, which is effectively a filter by list. This approach is more robust for long lists and large tables because the engine can optimise the join, and it tolerates type changes better. Expand only the columns you need afterwards, otherwise you pull unnecessary fields into the result.
7. Check Membership with List.ContainsAny and List.ContainsAll
For multi-valued columns — tags, categories, a cell like "Red, Blue" — List.ContainsAny(Text.Split([Tags], ", "), MyList) keeps a row if any token matches, while List.ContainsAll requires every item. Trim the split parts before comparing, or trailing spaces will break the match. These functions cover the "does this row contain any of these keywords" case that a plain equality filter cannot handle.
8. Reverse It with List.Contains (Not)
To exclude a set rather than keep it, negate the test: Table.SelectRows(Source, each not List.Contains(ExcludeList[Column1], [Region])). This is clearer than chaining <> comparisons and handles blank or null values predictably — nulls are not equal to anything in a list, so they pass the exclusion filter. Add a separate [Region] <> null test if you want blanks gone too.
9. Filter with a Text.Contains Pattern List
When your list holds fragments rather than full values, combine it with Text.Contains : . This keeps any row whose product name contains one of the patterns. It is slower than exact matching on very large tables, so filter down on date or region first to reduce the row count.
10. Parameterise the List for Reuse
For reports refreshed by many people, expose the list as a query parameter or a named range and reference it in the filter. In the Power Query Editor open Manage Parameters (Home tab) to create a text parameter that holds comma-separated values, then split it into a list inside the query. Anyone can edit the parameter and refresh without touching M code. Remember that parameters are typed, so set the type to Text and split on the delimiter explicitly.
How to Choose
The deciding factor is who owns the list and how often it changes, not how clever the M code looks. If the values are fixed and the task is a one-off cleanup, use the filter pane or Keep Rows — the cost of maintenance is irrelevant. If the list changes weekly or lives with a colleague, put it in its own query or parameter so it can be edited without opening the editor. If the list is long (dozens or hundreds of values) or the table is large, prefer a merge with an inner join: it reads better than a giant Table.SelectRows literal and the engine handles it efficiently. Case sensitivity is the next thing to decide; add Comparer.OrdinalIgnoreCase whenever human typing is involved. Finally, check data types on both sides before diagnosing "wrong results" — text against numbers is the single most common cause of an empty filter.
Frequently Asked Questions
Why does my filter return no rows?
Almost always a type mismatch (the list is text but the column is a number) or a case difference. Check the column type icon in the header and cast the list column to the same type. Then add a comparer if casing varies.
Can I paste a list of values directly into the filter?
Yes. The column filter menu has a search box where you can paste one value per line, and it will tick the matching checkboxes. For long lists, a separate list query is easier to maintain.
Is filtering by list faster than merging?
For short lists on small tables, yes, and it is simpler. For long lists or large tables, an inner merge on a typed column generally performs better and is easier to read.
How do I filter with wildcards or partial matches?
Use Text.Contains, Text.StartsWith or Text.EndsWith inside Table.SelectRows, optionally combined with List.Transform over a pattern list. Do not expect the list-based functions to do partial matching themselves.
Do these steps survive a refresh?
Yes, if the list lives in a query, table, or parameter. Filters baked into the step as literal values also survive, but they will not pick up new values added to the source.
Can I keep blanks when filtering by list?
No — null is not equal to any list entry, so blank rows are dropped. Add [Column] = null with or inside the filter if you need to retain them.
Final Thoughts
Start with the simplest method that fixes the problem today, but choose the one whose maintenance cost fits tomorrow: a hard-coded filter is fine for a one-off, and a separate list query or parameter is the better answer for anything refreshed regularly. Whatever you pick, verify the column types on both sides and decide deliberately about case sensitivity, because those two details cause nearly every "the filter isn't working" question. Once the list lives in one editable place, filtering by list becomes a routine part of the refresh instead of a rebuild each time.