Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Power Query Filter Column by List: Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Filtering a column in Power Query by a list allows you to keep only rows where the column values match items in a predefined list—ideal for narrowing down large datasets to specific categories, IDs, or names. This is faster and more accurate than manual filtering, especially with hundreds of values. You need Microsoft Excel with Power Query enabled (2016 or later) or Power BI Desktop. No additional add-ins are required.

What You'll Need

  • Microsoft Excel 2016 or later (including Excel 365) or Power BI Desktop
  • A table or query with a column you want to filter
  • A list of values to filter by (stored in a column, row, or separate table)

Step-by-Step

  1. Open your Excel workbook or Power BI Desktop file and load the data into Power Query. In Excel, go to the Data tab, then select From Table/Range. In Power BI, go to the Home tab and click Transform Data.
  2. Identify the column you want to filter. For example, if you're filtering sales data by region, locate the column labeled "Region" or similar.
  3. Prepare your filter list. This can be a column of values in another worksheet (e.g., a list of approved regions in Sheet2, column A), or a static list you type manually. If your list is in Excel, select the cells and press Ctrl+T to convert it to a table. Name this table (e.g., "FilterList") by typing the name in the Table Design tab.
  4. In Power Query Editor, go to the Home tab and click Advanced Editor. Note the query name (e.g., "Query1") at the top of the editor. Close the Advanced Editor.
  5. Go to the Queries pane on the left and find the query containing your filter list (e.g., "FilterList"). Right-click it and select Reference. This creates a new query that mirrors the list without duplicating the data.
  6. Go back to your main data query (the one you want to filter). In the Applied Steps pane, select the step just before the final one (usually "Changed Type" or "Filtered Rows").
  7. Click on the column header you want to filter. A dropdown arrow appears. Click it, then uncheck "Select All" to clear all selections.
  8. Click the "Filter by List" option at the bottom of the dropdown menu. A dialog box will appear asking you to select a list.
  9. In the dialog, select the referenced query you created in Step 5 (e.g., "FilterList"). Ensure the column name in the dropdown matches the column in your filter list (e.g., "Region"). Click OK.
  10. Power Query will now filter your main table to show only rows where the selected column matches any value in your filter list. Verify the results by scrolling through the data.
  11. Click Close & Load (in Excel) or Close & Apply (in Power BI) to return the filtered data to your worksheet or report.

Common Mistakes

  • Using a static list instead of a referenced query: If you type values directly into the filter dialog, you can’t update them later without reapplying the filter. Always reference a separate table query for dynamic updates.
  • Using the wrong column name in the filter dialog: The column selected in the dialog must match exactly. If your filter list has a header "Region" but your main table has "Area", the filter will fail silently.
  • Forgetting to remove blank or hidden rows from the filter list: Extra blanks or formatting in the source list will cause mismatches. Clean the filter list first using Remove Rows > Remove Blank Rows.
  • Applying the filter before referencing the list query: If you reference the list after trying to filter, the "Filter by List" option may not appear. Always create the reference first.
  • Using case-sensitive or trimmed values inconsistently: If your main data has "New York" and your list has "new york", the filter won’t match. Use Text.Proper or Text.Lower in a custom column to standardize case.

Tips

  • Use named tables for your filter lists—they auto-expand if you add rows, making your filter dynamic without reconfiguring Power Query.
  • For large lists (1,000+ items), performance improves if you remove unnecessary columns from the filter list query before referencing it.
  • Test your filter with a small subset first. Add 5-10 values to your list, apply the filter, and confirm results before scaling up.
  • If your list comes from a database or external source, connect directly to it in Power Query instead of copying manually. This keeps the list live and up to date.
  • Use the "View Native Query" option (right-click query > View Native Query) to see how Power Query translates your filter into SQL if you’re connecting to a database—this helps debug slow performance.
  • Save a backup of your workbook before applying complex filters. Power Query steps are reversible, but complex references can cause dependency issues.

Troubleshooting

  • The "Filter by List" option is missing. You likely didn’t create a reference to your filter list query. Go back, right-click the filter list query, select Reference, then return to your main query.
  • No rows appear after filtering. Check for extra spaces or hidden characters. In your filter list, use Transform > Trim to remove leading/trailing spaces. Also verify case matching.
  • Power Query says "The column could not be found". The column name in your filter list query doesn’t match the column you’re filtering. Rename the column in the filter list to match exactly, or use Rename in the Power Query editor.
  • Filter works but is slow. Reduce the number of columns in your filter list query to only the one you need. Also, avoid referencing large tables with hundreds of thousands of rows—filter them first in the source.
  • Changes to the filter list don’t update. Refresh the filter list query first (right-click > Refresh), then refresh the main query. If that doesn’t work, close and reopen the workbook.
  • Filter returns partial matches. Power Query does exact matching by default. If you need partial matches (e.g., "Apple" in "Apple Pie"), use Text.Contains in a custom column instead of Filter by List.

Frequently Asked Questions

Can I filter by a list from another Excel file?

Yes. In Power Query, go to Data > From File > From Workbook, then browse to the external file. Select the table with your filter list and load it as a new query. Reference it as described in the steps.

What if my filter list has duplicates?

Power Query will still work, but duplicates add no value and slow performance. Use Remove Duplicates on the filter list query before referencing it.

Can I use a dynamic list that changes every day?

Yes. If your list comes from a source like a SharePoint list, SQL table, or Excel file that updates daily, Power Query will refresh it automatically when you refresh the main query.

Does this work with numbers or only text?

Yes. The filter works with numbers, dates, and text. Ensure data types match: if your column is numeric but your list is text, convert the list using Transform > Data Type > Whole Number or Decimal Number.

Can I filter multiple columns at once using one list?

No. Filter by List applies to one column at a time. To filter multiple columns, repeat the process for each column using the same reference query.

Why does my filter disappear after refreshing?

This happens if the referenced query’s structure changes (e.g., column renamed or deleted). Re-apply the filter after ensuring the reference query’s column name and structure remain unchanged.