Excel Power Query Filter Rows: Practical Steps and Examples

Formulas & functions · Updated November 3, 2026

Excel Power Query Filter Rows: Practical Steps and Examples

To filter rows in Excel Power Query, open a query in the Power Query Editor, select the filter arrow in a column header, choose the values or conditions to keep, and then select Home > Close & Load. The filter becomes a saved query step, so you can refresh the results later instead of repeatedly filtering the source by hand.

What filtering does in Power Query

Power Query is Excel’s data-import and transformation tool. A filter tells a query which records to retain or exclude while preparing data. For example, you might keep only orders from the West region, remove rows with blank product names, or show transactions dated within a particular period. The filtered result can then be loaded to a worksheet or another destination.

A Power Query filter is different from the dropdown filter applied to a normal Excel table. A worksheet filter temporarily hides rows in the displayed table; it does not change the underlying table contents. A Power Query filter is part of the transformation instructions. When the query refreshes, Excel reads the source again and applies those instructions to the newly retrieved data.

Filtering in the query does not ordinarily delete records from the original source file or source table. It affects what the query returns. This distinction is useful when you want a smaller, cleaner report while keeping the complete source data available.

Open a query and apply a basic filter

These steps are for Excel for Microsoft 365 on Windows. If your data is already in a query, open Data > Queries & Connections, right-click the query, and choose Edit. For a new worksheet range, first select a cell in the data and choose Data > From Table/Range. Excel may ask whether the first row contains headers; confirm the setting that matches your data.

  1. In the Power Query Editor, find the column you want to filter and select its header’s filter arrow.
  2. For a list of distinct values, clear Select All, select the values to keep, and choose OK. For instance, selecting West in a Region column excludes rows for other regions.
  3. For a rule such as “greater than 500” or “contains urgent,” point to the appropriate filter category, such as Number Filters or Text Filters, choose a condition, enter the value, and confirm.
  4. Check the preview to make sure the retained records are the ones you intended. The row count shown in the editor can help reveal an unexpectedly broad or restrictive filter.
  5. Choose Home > Close & Load to return the result to Excel. To change where the query loads, use the Close & Load dropdown and choose Close & Load To when that option is available.

Power Query records each transformation in the Applied Steps pane. A filter commonly appears as a step named Filtered Rows. Select that step to see its effect, or use the gear icon beside it when available to adjust its settings. The editor can also show the formula bar; if it is hidden, enable it from the View tab.

Choose the right kind of filter

The filter menu depends on the column’s data type. Text columns offer value selection and text conditions; numeric columns offer comparisons and number ranges; date and time columns offer date-specific conditions. Confirm that Power Query has assigned the correct type before relying on those menus. A date stored as text, for example, may not offer the expected date filters and may sort in an unexpected order.

  • Select specific values: Use the checkbox list for a category field such as Region, Status, or Department. This is convenient when the list is short and the required values are known.
  • Use a condition: Choose a text, number, or date condition to define a rule. A numeric example is keeping Sales greater than or equal to 500; a text example is keeping descriptions that contain the word urgent.
  • Filter blanks: Use the null or blank entry in the menu to keep or exclude missing values. In Power Query, a genuinely missing value is generally represented as null; an empty text string is not always the same thing.
  • Filter errors: If a column contains error values, its menu can be used to retain or exclude errors. Consider investigating why they occur before removing them, especially if they indicate invalid source data or a failed type conversion.

Value lists are based on the data available to the editor’s preview and may be subject to preview limits. If a value you expect is not listed, use a condition where possible, check the source and data type, and refresh or reopen the preview. Do not assume that a short preview list proves the source contains only those values.

Combine more than one condition

Filters on separate columns normally narrow the result together. If you keep Region equal to West and separately keep Status equal to Shipped, a row must meet both filters to remain. This is an AND relationship. The order of those filter steps generally does not change the final set of rows, although it can affect how the query is evaluated or displayed in the step list.

Conditions within a single filter can offer both AND and OR choices. For example, a rule could keep orders where Sales is at least 500 and less than 1,000. An OR rule could keep rows where Region is West or East. Read the condition dialog carefully: using AND when you mean OR can produce an empty or unexpectedly small result.

For a concrete example, suppose an order table has Region, Status, OrderDate, and Sales columns. You can select West in Region, choose Shipped in Status, and set OrderDate to a suitable date range. Together, those steps return shipped West orders within that period. If the source adds new qualifying orders, a refresh can bring them into the output without rebuilding the filters.

Keep rows or remove rows from the ribbon

The column dropdown is best when a filter depends on values in a particular field. The Power Query Editor also has row-level commands on Home > Reduce Rows. Depending on the command, you can keep or remove top rows, bottom rows, a range of rows, duplicates, or other selected portions of a table. These commands answer different questions from a value filter.

For example, Keep Top Rows retains the first specified number of rows in the current order; it does not automatically mean the highest values. To keep the largest sales amounts, sort the Sales column in descending order first, then use Keep Top Rows. Likewise, Remove Duplicates removes rows according to the columns selected at that point, so confirm which columns define a duplicate before applying it.

Row position can change when the source changes or when earlier query steps reorder or filter records. If the requirement is “latest 20 orders,” a date sort followed by Keep Top Rows is more meaningful than keeping the first 20 rows in an arbitrary source order. If you need all records satisfying a business rule, use a condition-based filter rather than a row-count command.

Refresh behavior and query steps

After loading a query, use Data > Refresh All or refresh the individual query from the Queries & Connections pane to retrieve updated source data and reapply transformations. A filter on a fixed value, such as Region = West, continues to keep West rows. A filter defined by a relative date option may behave differently as time passes, so check the condition if the report is time-sensitive.

Refresh does not guarantee that every source will update in the same way. The source must be available, credentials and permissions must be valid, and the query’s connection must still work. If the query reads a workbook table, changes to that table can be included on refresh; if it reads a separate file, the path and file access matter. A filter cannot retrieve records that the source connection does not provide.

Power Query often performs steps in sequence. For example, it may promote headers, change data types, filter rows, and then remove columns. A filter can fail or produce surprising results if an earlier step changes the column name or type. When troubleshooting, select steps from top to bottom in Applied Steps and identify the first one where the preview diverges from expectations.

Power Query filters compared with worksheet filters

Use a worksheet filter when you only need to inspect or temporarily hide rows in a table that is already loaded. It is quick, familiar, and does not require editing a query. Use Power Query when the filter is part of a repeatable import or cleanup process, especially when the source is refreshed regularly or several transformations need to be applied consistently.

Power Query also makes the transformation history visible as steps, which helps explain how a report was produced. However, the loaded output is a query result, not simply a manually filtered view of the original source. Editing output cells is not a reliable way to change the query’s source records; make changes in the source or adjust the query, then refresh.

For a one-time task on a small range, a worksheet filter may be simpler. For recurring reports, filtering in Power Query can reduce repetitive work and make the process easier to maintain. The right choice depends on whether you need a temporary view or a repeatable data-preparation rule.

Common problems and practical fixes

  • The expected value is missing: Check whether the source has refreshed, whether the preview is complete, and whether the column contains extra spaces or a different spelling. A condition-based filter may be more suitable than selecting from a long value list.
  • A number or date filter is unavailable: Inspect the column icon and type. Use the Transform tab’s data type controls to assign an appropriate type, then review the filter. Converting badly formed text can create errors, so inspect the results after conversion.
  • Rows unexpectedly disappear: Review every Filtered Rows step and test whether conditions should be joined by AND or OR. Also check for nulls, spaces, and values that differ subtly, such as West and west.
  • Refresh returns an error: Confirm that the source location is accessible and that the query’s earlier steps still refer to existing columns. A renamed source column can break a later filter step.
  • The output changes order: Filtering does not itself promise a useful sort order. Add an explicit sort step when the order matters, and do so before a command that keeps a particular number of rows.

For readers who inspect the query logic, a simple filter is represented in Power Query’s M language by a step such as Table.SelectRows(#"Changed Type", each [Region] = "West" and [Sales] >= 500). Here, the preceding step must be named Changed Type and the columns must exist with compatible values. Most users can build the equivalent filter with the interface; the formula bar or Advanced Editor is useful when reviewing or adapting a query, but editing M requires care with step names, column names, and data types.

Mac and web considerations

The steps above describe Excel for Microsoft 365 on Windows. Excel for Mac has Power Query capabilities, but editor controls, connectors, and feature availability can differ by version. Excel for the web also has a different feature set from the Windows desktop editor. If a named command or editing control is absent, check the current capabilities for your Excel build and use desktop Excel for the fullest query-editing experience.

Frequently Asked Questions

Does filtering in Power Query delete rows from my source?
No. It filters the rows returned by the query; it does not normally delete records from the original workbook table or external source. The query output contains only the rows that pass the filter.

How do I filter a column for blank cells?
Open the column’s filter menu and select or clear the blank/null entry as needed. If the result is unexpected, check whether the cells contain nulls, empty text, or spaces, because those are not necessarily identical values.

Can Power Query filter dates such as the current month?
Yes. Date columns provide date filters, including relative date options in supported versions. Verify the column is typed as a date and confirm the chosen relative rule when refreshing a report over time.

How do I include either of two values?
Select both values in the column’s checkbox list, or use a filter condition with OR where that option is available. Separate filters on different columns generally combine as AND, so they require a row to satisfy both column filters.

Why does my filter disappear or change after refresh?
Refresh reapplies the saved query steps, but the result depends on the current source data and whether the query still finds the expected columns and types. Review Applied Steps and check for source changes, renamed fields, or a condition that excludes the new records.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.