Table.RemoveRowsWithErrors
TableRemoves rows that contain error values, optionally limited to specified columns.
Syntax
Table.RemoveRowsWithErrors(table as table, optional columns as nullable list) as tableParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | table | Yes | The table to clean. |
columns | list | No | Optional list of column names. Only rows with errors in those columns are removed. If omitted, all columns are checked. |
Return Value
table — The table with error-containing rows removed.
Remarks
Table.RemoveRowsWithErrors discards any row that contains an error value in at least one cell. When columns is specified, only errors in those columns trigger row removal — errors in other columns are ignored.
This is useful for cleaning data after a type conversion step (e.g., Table.TransformColumnTypes) that may have introduced errors for unparseable values.
Examples
Example 1: Remove all rows containing errors
let
Source = #table({"ID", "Value"}, {{1, 10}, {2, error "bad"}, {3, 30}})
in
Table.RemoveRowsWithErrors(Source)Result
ID | Value | |
|---|---|---|
| 1 | 1 | 10 |
| 2 | 3 | 30 |
Example 2: Only remove rows with errors in a specific column
let
Source = #table({"ID", "Value"}, {{1, error "bad"}, {2, 20}, {3, error "bad"}})
in
Table.RemoveRowsWithErrors(Source, {"Value"})Result
ID | Value | |
|---|---|---|
| 1 | 2 | 20 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks