Tutorials June 27, 2022 · 2 min read

Finding errors in Dataflows and PowerQuery

A simple Power Query script to pinpoint the exact rows causing refresh errors in your Power BI Dataflows.

Gregor Brunner Gregor Brunner
Finding errors in Dataflows and PowerQuery

Have you ever experienced refresh errors in your Power BI Dataflows and struggled to locate them? This post presents a helpful script that identifies the exact location of errors.

The Solution

Add the following code to the end of your transformation process in either Dataflows or PowerQuery:

GetRowNumber = Table.AddIndexColumn(#"ENTER PREVIOUS TRANSFORMATION STEP", "RowNumber", 1, 1, Int64.Type),
FindErrors = Table.SelectRowsWithErrors(GetRowNumber)
in
FindErrors

Remember to reference your previous transformation step in the first line.

Why This Matters

When a Dataflow refresh encounters errors, the error messages are often broad and unhelpful. Finding problematic rows manually becomes tedious, especially with large datasets — such as a dataset with 60,000 rows and eight columns.

How It Works

The script isolates rows producing errors and adds a column displaying the respective row number, allowing for quick identification of problem data.

Additional Considerations

Pay attention to source data issues like VLOOKUP errors in Excel. These manifest as “Invalid cell value” errors in Power BI, even when occurring in text columns, and can cause downstream processing failures.