Power Query List Filter: How to Filter Data by List Values
In this article
Power Query’s list filter lets you retain only rows where a column’s values match items in a predefined list, making it ideal for narrowing down large datasets using dynamic criteria like product IDs, region codes, or user names. This method is more flexible than static filters and supports updating the list without rewriting queries. You need Microsoft Excel with Power Query enabled (2016 or later) or Power BI Desktop installed.
What You'll Need
- Microsoft Excel 2016 or later (with Power Query enabled by default) or Power BI Desktop
- A data table with at least one column containing values you want to filter by
- A separate list of values you want to keep (e.g., a column in another sheet, a manually entered list, or a column from a different table)
- Basic familiarity with the Power Query Editor interface
Step-by-Step
- Open your Excel workbook or Power BI Desktop file and load the dataset you want to filter into Power Query. To do this, select any cell in your data table, then go to the Data tab and click From Table/Range (in Excel) or Get Data > From Table/Range (in Power BI).
- In the Power Query Editor, identify the column you want to filter. For example, if you’re filtering sales data by region, locate the column labeled Region or similar.
- Prepare your filter list. If your list is in another Excel sheet, load it into Power Query using the same method: select the range, then use From Table/Range. If you’re creating a manual list, click New Source > Blank Query, then in the Formula Bar, type {"Item1", "Item2", "Item3"} and press Enter. Rename this query to something like FilterList for clarity.
- With your main table still open in the Power Query Editor, go to the Home tab and click Advanced Editor. Note the name of your main query (e.g., Table1).
- Return to the main query’s interface. Click on the column header you want to filter. From the dropdown menu, uncheck Select All, then scroll to the bottom and select Filter by List.
- In the Filter by List dialog box, under "Use values from a list," select the query name of your filter list (e.g., FilterList). Ensure the column name from that list is correctly referenced. If the list is a single column, Power Query will auto-detect it; if it’s a single-value list (like a list of text), make sure you’re not selecting a table with multiple columns.
- Click OK. Power Query will now show only rows where the selected column matches any value in your filter list. Review the results to confirm correct filtering.
- Click Close & Load to return the filtered data to Excel or Power BI. If you’re working in Excel, the output will appear in a new worksheet; in Power BI, it will load into the data model.
- To update the filter later, simply edit the FilterList query — add or remove values — then refresh the main query by right-clicking the query name in the Queries pane and selecting Refresh. The filter will automatically apply the new list.
Common Mistakes
- Using a multi-column table as your filter list when only one column contains the target values. Power Query requires a single column of values; if your list has headers or extra columns, remove them first.
- Typographical mismatches between the filter list and the target column. Spaces, capitalization, or special characters (like em dashes vs. hyphens) will cause mismatches. Use Text.Trim and Text.Lower in Power Query to standardize both lists before filtering.
- Forgetting to refresh the query after updating the filter list. Changes to the FilterList query won’t take effect until you manually refresh the main query or the entire workbook.
- Applying the filter to a column with mixed data types. If your target column contains both numbers and text, and your filter list is entirely text, Power Query may not match any values. Ensure data types match (e.g., convert both to text using As Text in the Transform tab).
- Accidentally selecting the wrong column in the Filter by List dialog. Double-check that you’re referencing the correct column from your filter list query, not the main table’s column.
Tips
- Use named ranges in Excel for your filter list to make it easier to update. Name the range (e.g., FilterRegion) and then reference that named range in Power Query by selecting From Table/Range — it will auto-detect the range name.
- For dynamic lists that change often, store your filter values in a separate sheet and use Excel’s Table feature (Ctrl+T) to convert the range into a structured table. Power Query will automatically expand the list if you add new rows.
- Test your filter with a small subset first. Create a dummy list with 3–5 values and verify the filter works before applying it to your full dataset.
- Use the Advanced Editor to manually write the filter if needed: Table.SelectRows(Source, each List.Contains(FilterList, [ColumnName])). This gives you more control and is useful for complex logic.
- When filtering large datasets, list-based filtering is significantly faster than multiple OR conditions. Power Query optimizes List.Contains internally.
- Save a backup copy of your workbook before applying complex filters. While Power Query is reversible, it’s easier to revert if something goes wrong.
Troubleshooting
- No rows appear after filtering. Check if your filter list contains any values that exactly match the target column. Use the View > Advanced Editor to inspect the values in both lists. Look for hidden characters — select a cell in your filter list, press F2, and check for trailing spaces.
- Power Query says "The column was not found" in the Filter by List dialog. Your filter list query may have been renamed or deleted. Go to the Queries pane, confirm the filter list query still exists and is spelled exactly as shown in the dialog. If renamed, recreate the filter or edit the query in Advanced Editor.
- Filter works in Power Query Editor but not after loading. This usually means the data type changed after loading. In Excel, right-click the column in the output table and ensure it’s formatted as Text. In Power BI, check the column data type in the Data view.
- Filter list is too large and causes performance issues. Lists over 10,000 items can slow down filtering. Consider using a join instead (Merge Queries) if you’re matching against a large external table.
- Filter list contains null or blank values. Power Query will treat blank as a match for blank rows. If you don’t want blanks included, filter them out of your FilterList query before using it: select the column > Transform > Remove Blank Rows.