1---2name: dataflow-gen23description: Use when building no-code/low-code data transformations in Microsoft Fabric with Dataflow Gen2, configuring Power Query transformations, setting up incremental refresh, or studying for DP-700 (Microsoft Fabric Data Engineer Associate).4---56# Dataflow Gen278## When to Use9- Building data transformations without writing PySpark code in Microsoft Fabric10- Connecting to 150+ data sources using Power Query's no-code interface11- Setting up incremental refresh to load only new or changed data12- Loading transformed data to Lakehouse tables, Warehouse, or Azure SQL13- Deciding between Dataflow Gen2 and Spark Notebooks for a transformation task14- Preparing for Microsoft Fabric Data Engineer Associate (DP-700) exam1516## Core Jobs1718### 1. Dataflow Gen2 Architecture19- **Dataflow Gen2** = Power Query Online interface with staging layer in Microsoft Fabric20- 150+ data source connectors: files (CSV, Excel, JSON, Parquet), databases (SQL Server, Snowflake, Oracle), cloud services (SharePoint, Salesforce, REST APIs)21- Transformation engine: M language (Power Query formula language); visually authored22- Staging layer: intermediate OneLake storage during transformation (reduces source load)23- Final output written to configured **data destinations**2425### 2. Staging Layer26- Staging = temporary OneLake storage where intermediate results land during transformations27- Automatically enabled by default; can be disabled per query28- Benefits: reduces repeated calls to source systems; enables parallel transformation steps29- Staging storage: always OneLake (cannot change to external storage)30- Important: staging is temporary; only the final data destination persists3132### 3. Data Destinations33| Destination | Use Case |34|-------------|----------|35| **Fabric Lakehouse** (table) | Most common; Delta table in Lakehouse `Tables/` |36| **Fabric Warehouse** (table) | SQL-first teams; T-SQL accessible |37| **Azure SQL Database** | Hybrid scenarios; push to existing SQL workloads |38| **Fabric KQL Database** | Real-time analytics (Eventhouse) |3940- One Dataflow Gen2 can have **multiple data destinations** (one per query)41- Destination mode: **Append** (add rows), **Replace** (overwrite), **Merge** (upsert on key)4243### 4. Incremental Refresh44- Only loads new or changed data since the last refresh (avoids full re-scan)45- Requirements:46 1. Source must have a reliable datetime column (e.g., `ModifiedDate`, `EventTimestamp`)47 2. Define **RangeStart** and **RangeEnd** parameters (datetime type) in Power Query48 3. Filter source query by: `Table.SelectRows(Source, each [ModifiedDate] >= RangeStart and [ModifiedDate] < RangeEnd)`49- Fabric manages the date window automatically on each refresh cycle50- Not supported for all connectors (check source compatibility)5152### 5. Dataflow Gen2 vs Notebooks Decision53| Criteria | Dataflow Gen2 | Spark Notebook |54|----------|---------------|----------------|55| User skill | Business analyst, no-code | Data engineer, PySpark |56| Transformation complexity | Low-medium (Power Query M) | High (arbitrary Python/Spark) |57| Scale | Medium datasets | Very large datasets (TB+) |58| Scheduling | Built-in refresh schedule | Manual or Pipeline trigger |59| ML/AI logic | Not supported | Full Python ecosystem |60| Best for | ETL from business systems | Large-scale data engineering |6162Decision rule: Choose **Dataflow Gen2** for straightforward ETL from standard connectors; use **Notebooks** for complex transformations, ML, or very large data volumes.6364### 6. Scheduling and Pipeline Integration65- Standalone schedule: configure refresh frequency (hourly, daily, weekly) in Fabric workspace66- **Fabric Pipeline integration**: add Dataflow Gen2 as a **Dataflow activity** in Pipeline67- Pipeline enables: sequential execution with other activities (Copy Data, Notebook), conditional logic, parameterization68- Dataflow activity in Pipeline can pass parameters to override connector settings6970## Key Concepts71- **Power Query** — visual data transformation engine; M language under the hood72- **Staging** — intermediate OneLake storage during transformation; reduces source load73- **Data destination** — final output target (Lakehouse table, Warehouse, SQL); persists after refresh74- **RangeStart / RangeEnd** — required datetime parameters for incremental refresh75- **Dataflow Gen1** — Power BI-only Dataflow; no staging, fewer destinations; legacy, do not confuse with Gen276- **M language** — Power Query formula language; functional, lazy-evaluated; authored visually7778## Checklist79- [ ] Dataflow Gen2 (not Gen1) selected when working in Microsoft Fabric?80- [ ] Staging enabled (default) to reduce repeated calls to source systems?81- [ ] Data destination configured for each output query (Lakehouse table, etc.)?82- [ ] Incremental refresh set up with RangeStart/RangeEnd parameters for large sources?83- [ ] Source connector supports the required authentication method (OAuth, key, managed identity)?84- [ ] Dataflow Gen2 activity added to Fabric Pipeline when orchestration is needed?85- [ ] Notebook used instead when transformation requires PySpark or Python libraries?8687## Output Format88- 🔴 **Critical** — using Dataflow Gen1 (Power BI Dataflows) expecting Fabric destinations89- 🔴 **Critical** — incremental refresh missing RangeStart/RangeEnd parameters (full refresh will run)90- 🟡 **Warning** — Dataflow Gen2 used for TB-scale data where Spark Notebook would perform better91- 🟡 **Warning** — no staging configured; source system queried multiple times per refresh92- 🟢 **Suggestion** — embed Dataflow Gen2 in Fabric Pipeline for orchestrated, conditional execution9394## Exam Tips95- **Dataflow Gen2 ≠ Dataflow Gen1** — Gen2 has staging layer, more destinations (Lakehouse, Warehouse), and is Fabric-native; Gen1 is Power BI-only with fewer capabilities96- **Staging must be OneLake** — cannot configure external storage for staging; reduces load on source during transformation97- **Incremental refresh requires RangeStart and RangeEnd parameters** — must be datetime type; Power Query filters source by this range automatically on each run98- **Dataflow Gen2 supports multiple data destinations** — one per query in the same Dataflow; each can go to a different Lakehouse or table99- **For complex PySpark transformations, use Notebooks** — Dataflow Gen2 is Power Query (M), not Python/Spark100- **Dataflow Gen2 as activity in Fabric Pipelines** — enables orchestration with Copy Data, Notebook, and other pipeline activities; trigger on schedule or event