Table.SelectRowsWithErrors

Table

Returns rows that contain at least one error value, 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.SelectRowsWithErrors(table as table, optional columns as nullable list) as table

Parameters

NameTypeRequiredDescription
tabletableYesThe table to inspect.
columnslistNoOptional list of column names. Only errors in those columns qualify a row. If omitted, all columns are checked.

Return Value

table — A table containing only rows that have at least one error value.

Remarks

Table.SelectRowsWithErrors is the complement of Table.RemoveRowsWithErrors. It returns only the rows that contain at least one error, useful for auditing and diagnosing data quality issues after import or type conversion steps.

When columns is specified, only errors in those columns cause a row to be included. Errors in other columns are ignored.

Examples

Example 1: Return all rows that contain errors

let
    Source = #table({"ID", "Value"}, {{1, 10}, {2, error "bad"}, {3, 30}})
in
    Table.SelectRowsWithErrors(Source)
Applied Steps

The final output — only row 2, the one row with an error in any column, is kept.

ID
Value
12[Error]

Example 2: Only check a specific column for errors

let
    Source = #table({"ID", "Value"}, {{1, error "bad"}, {2, 20}, {3, error "bad"}})
in
    Table.SelectRowsWithErrors(Source, {"Value"})
Applied Steps

The final output — rows 1 and 3 are kept because their Value column contains an error.

ID
Value
11[Error]
23[Error]

Compatibility

✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks
Contributors
kyleamueller