Table.RemoveRowsWithErrors
Table function · By Tahir Nas · Examples run in our simulator · Published · Updated
Removes rows that have an error in given columns.
When to use it
Use it when error rows are genuinely unusable and the count is known. For data you need to report on, keep the errors visible instead (Keep Errors in a separate query) so problems aren't silently dropped.
Syntax
Table.RemoveRowsWithErrors(table as table, optional columns as nullable list) as tableParameters
- columns
- Columns to check; all columns if omitted.
Returns
The table without error rows.
Example
Table.RemoveRowsWithErrors(Table.TransformColumnTypes(#table({"Qty"}, {{"3"}, {"n/a"}}), {{"Qty", Int64.Type}}), {"Qty"})Result
| Qty |
|---|
| 3 |
Example: check only some columns
Rows with errors in other columns are kept.
Table.RowCount(Table.RemoveRowsWithErrors(Table.TransformColumnTypes(#table({"Qty", "Note"}, {{"3", "a"}, {"x", "b"}}), {{"Qty", Int64.Type}}), {"Qty"}))Result
1
Both results are produced by the Power Query Exercises simulator, an independent implementation of a documented subset of M, and checked on every build.
Good to know
- Apply after the step that creates the errors.
Common mistakes
- Removing errors before finding out why they happen.
- Applying it before the step that creates the errors.
The matching command in Excel
- Excel for Windows
- Select the column > Home > Remove Rows > Remove Errors
- What you see
- Rows with an error in the selected column are dropped.
Paths are for the Power Query editor in Excel for Microsoft 365, checked against Microsoft's documentation on 8 November 2026: Dealing with errors in Power Query (Microsoft Learn).
Exercises that use Table.RemoveRowsWithErrors
Learn more
Related functions
Official documentation: Table.RemoveRowsWithErrors on Microsoft Learn.