Table.RemoveRowsWithErrors

Table

Removes rows that contain error values, optionally limited to specified columns.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Table.RemoveRowsWithErrors(table as table, optional columns as nullable list) as table

Parameters

NameTypeRequiredDescription
tabletableYesThe table to clean.
columnslistNoOptional list of column names. Only rows with errors in those columns are removed. If omitted, all columns are checked.

Return Value

tableThe 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
1110
2330

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
1220

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks