Bulletproof Your Dataflows: Error Handling and Data Quality in Fabric

Description

Modern data solutions depend on reliable pipelines, yet error handling and data quality checks are often overlooked until failures occur in production. This session dives deep into building resilient Dataflows Gen2 solutions leveraging try/otherwise, structured error outputs, custom error messages, and partial failure patterns, centralizing error logs in dedicated tables for downstream monitoring.

Key Takeaways

My Notes

Action Items

Slides

2026-03-06
Bulletproof Your
Dataflows:
Error Handling and
Data Quality in Fabric
Cristian Angyal
About me
o Electrical Engineering background
o Former Project Manager (PMP®, PMI-ACP®)
o Microsoft Certified Professional
(DP-600, DP-700, PL-300, MCT, MCSA, MCSE, MOS Master)
o Romania PBI and Modern Excel UG Founder
Cristian Angyal
https://www.meetup.com/romaniapug
o Microsoft MVP (Excel & Power BI)
/cristian-angyal
https://linktr.ee/cristiangyal
o Husband (25y+) and proud father
#NeverStopLearning
o Love to ski, travel and learn
Session Plan
Dataflows Gen2 - Short Overview
Error Types in Power Query M
Handling Errors: try/otherwise, try/catch, structured patterns
Cell-Level Errors - Detect, Isolate, Route
DEMO - Lakehouse Error Handling in Fabric
Centralized Error Log Table
Best Practices & Wrap-up
What are Dataflows Gen2?
Data Transformation & preparation engine in Microsoft Fabric
Extract
Transform
Load
Refresh
Connect to 150+ data
sources:
Lakehouse, Warehouse,
SQL, APIs, Files,
SharePoint, and more
Power Query M: full ETL
capabilities
UI-driven or advanced M
code editing
Write directly to Fabric
Lakehouse,
Data Warehouse, or other
destinations
Scheduled, on-demand,
or triggered
via Fabric Pipeline
orchestration
Key differences vs. Power BI Dataflows (Gen1)
Native Lakehouse & Warehouse output destinations
Staging layer automatic or configurable
Fabric Pipeline integration for orchestration and error monitoring
How Power Query M Works
Every M expression must produce exactly one of two outcomes:
A Value



Scalar: text, number, date, logical
Structured: list, record, table
Binary, function, type
An Error



Expression could NOT produce a value
Always has 3 components: Reason,
Message, Detail
Can propagate or be caught and handled
Today's focus: understanding, catching, routing, and logging errors
Anatomy of a Power Query Error
Every error in M is a record with 3 fields:
Reason
The error category. Defaults to "Expression.Error" if not specified.
Examples: DataFormat.Error, Expression.Error, DataSource.Error
Message
Human-readable explanation of what went wrong.
Can be a plain string or structured with Message.Format + parameters.
Detail
Additional context. Can be any M value — a record, a list, a table.
This is where you put your custom diagnostic data.
// Raising a custom error
error [
Reason = "DataFormat.Error",
Message = "Invalid date format in source file",
Detail = [SourceFile = "sales_2024.csv", ColumnName = "OrderDate", Value = "31/02/2024"]
]
Two Types of Errors in Power Query
STEP-LEVEL Errors
CELL-LEVEL Errors (Value Errors)

Prevents the entire query from loading

Does NOT stop the query from loading

Data Source Errors - file/DB not found

Data Type Conversion Errors - most common

Step Formula Errors - syntax, type mismatch

Operation Errors - e.g. divide by zero, null ops

Precedent Query Errors - upstream failure

Custom validation errors you raise explicitly

Formula Firewall Errors - privacy level conflicts
In Fabric: these block the Dataflow run
and surface as Pipeline activity failures
PQ silently replaces errors with null
→ silent data quality issues!
This is the focus of today's demo.
Dealing with Errors in M
Five strategies — choose based on your data quality requirements:
Ignore
Let PQ silently replace errors with null.
Only acceptable if null is a valid value.
Remove
Use Table.RemoveRowsWithErrors to delete rows with errors.
Good when error rows have no salvageable data.
Replace
Use Table.ReplaceErrorValues with a default/fallback value.
Good for non-critical fields with known defaults.
Keep
Use Table.SelectRowsWithErrors to isolate error rows.
Great for building a dedicated error inspection table.
Leverage
Use try/otherwise or try/catch to handle errors per-cell
and extract structured error data. Most powerful pattern.
try … otherwise