Microsoft Power BI • Connecting to Data

Datasets, Dataflows & Semantic Models — Explain datasets, dataflows, and semantic models at a high level (conceptual)

Understanding the three foundational abstractions that govern how Power BI ingests, transforms, and exposes data for analytics.

Microsoft Power BI emblem with a dashboard, stacked chart, and database.
Inside this lesson 10 sections 5 questions 5 figures

SECTION 1

Historical Context & Motivation

Before self-service business intelligence tools existed, enterprise reporting relied on rigid, centrally-managed data warehouses with long development cycles. Analysts who needed a new metric or a freshly joined table often waited weeks for IT to provision the change, creating a bottleneck that slowed decision-making across organizations. Microsoft Power BI emerged as part of a broader industry shift toward self-service analytics, empowering business users and developers alike to connect to data, shape it, and build interactive reports without requiring a full data-warehousing project. To make this vision practical at scale, Power BI introduced three layered abstractions—datasets, dataflows, and semantic models—each solving a distinct problem in the data-to-insight pipeline.

2010 • Power Pivot Add-in for Excel

Microsoft released Power Pivot, introducing the in-memory xVelocity (VertiPaq) engine. It allowed analysts to build columnar data models inside Excel, planting the seeds for what would become datasets and semantic models in Power BI.

2015 • Power BI Service GA

Power BI became generally available as a cloud service. Reports published to the service contained embedded datasets—compressed analytical stores that could be refreshed on a schedule and shared across workspaces.

2019 • Dataflows Introduced

Dataflows brought Power Query (M) transformations to the cloud, letting teams define reusable ETL logic stored in Azure Data Lake Storage Gen2 as standardized CDM (Common Data Model) entities. This decoupled data preparation from report authoring.

2023 • Semantic Models Rebrand

Microsoft officially renamed 'datasets' to semantic models in Power BI, signaling that the artifact is far more than raw data—it encapsulates relationships, DAX measures, hierarchies, and security rules that give meaning to numbers.

2024 • Dataflows Gen2 in Microsoft Fabric

Dataflows Gen2, part of the broader Microsoft Fabric platform, unified data ingestion across Power BI, Azure Synapse, and Data Factory, reinforcing the conceptual separation of ingestion, transformation, and modeling as distinct, composable layers.

The core architectural question these abstractions answer is deceptively simple: How do you move data from heterogeneous sources into a form that supports fast, interactive, and governed analytics? Understanding the boundaries between datasets, dataflows, and semantic models is essential for designing Power BI solutions that are maintainable, performant, and secure—skills that map directly onto software-engineering principles like separation of concerns and single responsibility.

SECTION 2

Core Principles & Definitions

At the highest level, Power BI's data architecture follows a pipeline pattern familiar to anyone who has studied compiler design or Unix pipelines: raw input is progressively refined through discrete stages, each of which adds structure and meaning. The three primary abstractions—dataflows, datasets (now formally called semantic models), and the broader semantic layer—each own a specific stage in this pipeline. Grasping their roles prevents the common anti-pattern of embedding all ETL logic and business rules into a single, monolithic .pbix file.

1

Dataflow

A cloud-hosted, reusable ETL pipeline defined with Power Query (M language). Dataflows connect to sources, apply transformations (filtering, joining, pivoting), and persist the output as standardized entities in Azure Data Lake Storage. They are analogous to materialized views or staging tables in a data warehouse.
2

Dataset (Legacy Term)

The in-memory analytical store published to the Power BI Service. A dataset contains imported tables (or DirectQuery connections), relationships between those tables, DAX measures, and calculated columns. It is the engine that actually answers queries from reports and dashboards.
3

Semantic Model

The modern, official name for a Power BI dataset. The rename emphasizes that this artifact is a semantic layer—it defines business meaning through relationships, hierarchies, display formatting, RLS rules, and aggregation behavior, not merely a container of rows and columns.
4

Separation of Concerns

Dataflows handle extraction and transformation; semantic models handle modeling and business logic; reports handle presentation. This mirrors the MVC pattern in software engineering: each layer can evolve independently.
5

Reusability & Governance

Dataflows and semantic models can be shared across workspaces and consumed by multiple reports. Certified and promoted datasets act like versioned, canonical APIs for analytics, reducing duplicated logic and ensuring a single source of truth.
✦

KEY TAKEAWAY

Think of it like a software build system. A dataflow is the build script that fetches source code (raw data) and compiles it into object files (clean, structured entities). A semantic model is the linker that combines those object files, resolves references (relationships), and produces an executable binary (an optimized analytical store) that any front-end application (report or dashboard) can run against. Separating compilation from linking gives you modularity, caching, and parallel development—exactly the same benefits you get from separating dataflows and semantic models.

SECTION 3

Visual Explanation — The Data Pipeline

Power BI Data Pipeline: Sources → Dataflows → Semantic Models → ReportsSQL ServerREST APIExcel / CSVSharePointData SourcesDATAFLOW(Power Query / M)Filter & Clean RowsJoin / Merge TablesType Casting & PivotsOutput → CDM EntitiesADLSSEMANTIC MODEL(VertiPaq / DirectQuery)Tables & RelationshipsDAX MeasuresHierarchiesRow-Level SecurityFormatting & MetadataReport ADashboardPaginatedConsumersLayer ResponsibilitiesSources: Raw dataDataflows: ETL / StagingSemantic: ModelingReports: Presentation
The diagram above illustrates the four-stage Power BI data pipeline. Data sources (left) feed into a dataflow that performs extraction and transformation via Power Query M. Clean entities are stored in Azure Data Lake Storage (ADLS) and loaded into a semantic model that adds relationships, DAX measures, hierarchies, and row-level security. Finally, multiple reports and dashboards consume the semantic model as a shared, governed analytical layer.

Notice how each layer in the diagram encapsulates a distinct responsibility. The dataflow knows nothing about DAX measures or report visualizations; the semantic model is agnostic to whether data came from a SQL database or a REST API; and the reports simply issue DAX queries against the semantic model without caring how the underlying tables were populated. This decoupling is structurally identical to the layered architecture pattern taught in software engineering: each layer depends only on the layer immediately below it, and changes in one layer do not cascade upward unless the interface contract changes.

SECTION 4

How Each Abstraction Works Under the Hood

Dataflows — Cloud-Hosted ETL

A dataflow is authored in the Power BI Service (or Power Apps) through a browser-based Power Query editor. Each dataflow contains one or more entities—analogous to tables—that are defined by M-language scripts. When the dataflow refreshes, the Power BI backend spins up a compute engine that connects to the specified sources, executes the M transformations, and writes the results as compressed Parquet/CSV files into a Common Data Model (CDM) folder structure in Azure Data Lake Storage Gen2. Because the output resides in open-format storage, other services—Azure Synapse, Databricks, or even a second Power BI workspace—can also consume it, turning the dataflow into a reusable data contract.

Semantic Models — The VertiPaq Engine

When data is imported into a semantic model, the VertiPaq engine (also called the xVelocity in-memory analytics engine) compresses each column using a combination of run-length encoding (RLE) and dictionary encoding. Low-cardinality columns (e.g., country codes) compress extremely well under RLE, often achieving 10:1 or better compression ratios, while high-cardinality columns (e.g., transaction IDs) fall back to dictionary encoding. This columnar storage model is optimized for the scan-and-aggregate access pattern typical of analytical queries, and it is the reason Power BI can perform sub-second aggregations over millions of rows on commodity hardware.

COLUMN COMPRESSION RATIO

CR=Sraw/ScompressedCR = S_raw / S_compressed

Where CR is the compression ratio, S_raw is the raw column size in bytes, and S_compressed is the VertiPaq-compressed size. High CR values (typically 5×–15× for well-modeled star schemas) reduce memory footprint and improve cache-line utilization during column scans.

DirectQuery vs. Import Mode

Not every semantic model imports data into VertiPaq. In DirectQuery mode, the semantic model retains the schema, relationships, and DAX measures but stores no data locally. Instead, each visual interaction generates a DAX query that is transpiled into the source system's native query language (e.g., T-SQL for SQL Server). This trades latency for freshness—every visual renders with real-time data, but aggregation performance depends entirely on the source system's capabilities. Composite models blend both modes within a single semantic model, importing high-volume fact tables while keeping frequently-changing dimension tables in DirectQuery.

💡

Design Insight

The choice between Import and DirectQuery is analogous to the eager vs. lazy evaluation trade-off in functional programming. Import mode eagerly materializes all data at refresh time, paying a high upfront cost for fast subsequent queries. DirectQuery lazily evaluates data at query time, avoiding materialization but incurring per-query latency.

SECTION 5

Detailed Breakdown — Dataflows Gen1 vs. Gen2 and Semantic Model Connectivity Modes

Dataflow Generations & Semantic Model Connectivity ModesDataflow Gen1• Power Query Online editor• Output → CDM entities in ADLS Gen2• Linked / computed entities supported• Workspace-scoped refresh schedule• Available in Power BI Pro & PremiumEngine: Mashup / Power Query OnlineStorage: Azure Data Lake (CDM format)Dataflow Gen2 (Fabric)• Power Query Online editor (enhanced)• Output → Lakehouse tables or Warehouse• Staging toggle per query• Pipeline-integrated (Data Factory)• Fabric capacity requiredEngine: Mashup + Spark (hybrid)Storage: OneLake (Delta / Parquet)Semantic Model Connectivity ModesImportData copied intoVertiPaq (RAM)Fastest queriesDirectQueryQueries forwardedto source systemReal-time dataCompositeMix Import +DirectQuery tablesFlexible trade-offLive ConnectionThin client toexternal AS modelNo local model← Lower latency, higher memory Lower memory, higher latency →
Top row: comparison of Dataflow Gen1 (Power BI native) versus Dataflow Gen2 (Microsoft Fabric). Bottom row: the four connectivity modes available within a semantic model, arranged along a trade-off spectrum between query latency and data freshness.

The distinction between Gen1 and Gen2 dataflows matters architecturally. Gen1 dataflows store their output as CDM-formatted files in Azure Data Lake, which other Power BI datasets then import. Gen2 dataflows, embedded in Microsoft Fabric, can write directly to a Lakehouse backed by Delta tables, enabling Spark-based downstream processing without re-ingestion. From a systems-design perspective, Gen2 reduces the number of data copies in the architecture—an application of the single writer principle that minimizes consistency bugs.

For semantic models, the connectivity mode determines the caching strategy. Import mode is analogous to an eagerly populated cache: data is fully materialized in RAM at refresh time, yielding sub-second query performance but potentially stale data between refreshes. DirectQuery is a cache-miss strategy: every query hits the source, so data is always current at the expense of latency. Composite mode is a hybrid cache—hot tables imported, cold tables queried on demand—echoing L1/L2 cache hierarchies in CPU architecture.

SECTION 6

Worked Example — Designing a Multi-Source Sales Analytics Solution

Suppose you are a data engineer at a mid-size e-commerce company. Sales transactions live in an Azure SQL Database, product catalog data is in a SharePoint list, and marketing spend data arrives as weekly CSV exports from a third-party vendor. You need a Power BI solution that lets analysts explore revenue by product category, compare marketing ROI across channels, and filter by region—all from a single dashboard that refreshes daily.

End-to-End Architecture Design

  1. 1

    Step 1 — Identify Data Sources and Assess Freshness Requirements

    List each source and its characteristics. Azure SQL Database holds transactional fact data (millions of rows, daily batch is acceptable). SharePoint contains dimension data (product names, categories—updated infrequently). CSV files arrive weekly and need cleansing (inconsistent column names, missing values). Because no source requires real-time data, Import mode is appropriate for the semantic model.
    All three sources identified; Import mode selected for daily refresh cadence.
  2. 2

    Step 2 — Design Dataflows for Reusable ETL

    Create a dataflow in the shared workspace with three entities: SalesTransactions (from Azure SQL, filtered to the last 3 years, column types enforced), Products (from SharePoint, with category hierarchy columns extracted), and MarketingSpend (from CSV, with column renaming, null handling, and date parsing). Each entity encapsulates its cleaning logic so that other teams can reuse the same clean data without duplicating transformations.
    Three dataflow entities created; transformation logic centralized and version-controlled.
  3. 3

    Step 3 — Build the Semantic Model

    In Power BI Desktop, connect to the dataflow entities as the data source (Data > Get Data > Dataflows). Create a star schema with SalesTransactions as the fact table and Products / MarketingSpend as dimension tables. Define relationships: SalesTransactions[ProductID] → Products[ProductID] (many-to-one). Add a shared DateTable generated via DAX for time intelligence.
    Star-schema semantic model with three fact/dimension tables and a date dimension.
  4. 4

    Step 4 — Add Business Logic with DAX Measures

    Define measures such as Total Revenue = SUM(SalesTransactions[Amount]) and Marketing ROI = DIVIDE([Total Revenue] - SUM(MarketingSpend[Spend]), SUM(MarketingSpend[Spend])). Set display formatting (currency with two decimals for revenue, percentage for ROI). Create a hierarchy in the Products table: Category → Subcategory → Product Name. Configure row-level security so each regional manager sees only their region's data.
    Business logic, formatting, hierarchies, and RLS encapsulated in the semantic model.
  5. 5

    Step 5 — Publish, Certify, and Connect Reports

    Publish the semantic model to the Power BI Service. Certify the dataset (now semantic model) so other analysts across the organization can discover it via the data hub. Schedule daily refresh at 6 AM UTC aligned with the dataflow refresh. Build the report in a separate .pbix file using a live connection to the published semantic model, ensuring report and model lifecycle can evolve independently.
    Decoupled architecture: dataflow (ETL) → semantic model (business logic) → report (presentation).

SECTION 7

Strengths, Limitations & Trade-Offs

AbstractionStrengthsLimitations
DataflowReusable ETL across multiple semantic models; centralized data cleaning; no need for Power BI Desktop; outputs open-format files consumable by non-Power BI tools.Requires Premium/PPU or Fabric capacity; limited to Power Query transformations (no Python/Spark in Gen1); can add refresh latency as an additional pipeline stage.
Semantic Model (Import)Sub-second query performance via VertiPaq compression; full DAX expressiveness; supports complex star/snowflake schemas with calculated tables and measures.Data staleness between refreshes; memory-bound (1 GB limit in shared capacity, 400 GB in Premium P5); refresh can be slow for very large models.
Semantic Model (DirectQuery)Always-current data; no memory footprint for row storage; suitable for regulatory scenarios requiring no data duplication.Query performance limited by source system; not all DAX functions supported; each visual interaction generates source queries, increasing load on transactional databases.
Semantic Model (Composite)Best-of-both-worlds: import hot tables, DirectQuery cold/large tables; aggregation tables accelerate queries over DirectQuery sources.Increased architectural complexity; relationship cross-source limitations; requires careful aggregation design to avoid performance regressions.

Comparison of Power BI data abstractions by strengths and limitations

✦

KEY TAKEAWAY

Choosing between these abstractions is a system design decision, not merely a tool selection. Think of it like choosing between a monolith and microservices in application architecture. A monolithic .pbix file (embedding all ETL, modeling, and visualization) ships quickly but becomes unmaintainable at scale. Decomposing into dataflows and shared semantic models is like extracting services: each component has a clear interface, can be versioned independently, and can be owned by different teams. The trade-off is operational overhead—more moving parts to monitor and orchestrate.

SECTION 8

Connection to Microsoft Fabric & Advanced Theory

Microsoft Fabric represents the next evolutionary step for these abstractions. In Fabric, the boundaries between dataflows, semantic models, and the underlying storage are further blurred by the OneLake unified storage layer, which provides a single copy of data in Delta Parquet format accessible by every Fabric workload—Data Engineering (Spark), Data Warehousing (T-SQL), Data Science (notebooks), and Power BI. This eliminates the CDM-to-VertiPaq ingestion hop that Gen1 dataflows required, reducing data duplication and refresh latency. The semantic model in Fabric can issue Direct Lake queries—a new mode that reads columnar data directly from Delta tables in OneLake without a full import refresh, achieving near-Import performance with near-DirectQuery freshness.

AspectTraditional Power BIMicrosoft Fabric
StorageVertiPaq (proprietary in-memory) + optional ADLS CDM for dataflowsOneLake (Delta Parquet, open format), shared across all workloads
ETL EnginePower Query (M) via Mashup enginePower Query + Spark (hybrid execution in Dataflows Gen2)
Semantic Model ModeImport, DirectQuery, CompositeImport, DirectQuery, Composite, Direct Lake
GovernanceCertification & endorsement; workspace-level RLSMicrosoft Purview integration; OneLake data access roles; column-level security
Inter-workload AccessManual export or ADLS CDM consumptionAutomatic OneLake shortcuts; Spark, SQL, and BI access same data

Traditional Power BI vs. Microsoft Fabric capabilities

Looking forward, the trajectory is clear: the industry is converging on open table formats (Delta, Iceberg) as the canonical storage layer, with semantic models becoming thin, metadata-rich overlays that define business meaning without owning the data. This mirrors the evolution from thick-client database applications to modern REST API architectures where the schema and business rules live in a service layer while the raw data lives in a shared data store. As a computer science student, understanding this architectural pattern prepares you not just for Power BI, but for any modern data platform—Snowflake, Databricks, Google BigQuery—all of which are adopting similar semantic-layer strategies.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Explain, in your own words, why Microsoft renamed 'datasets' to 'semantic models.' What aspects of the artifact does the new name emphasize that the old name did not?
Show answer
The term 'dataset' suggests a passive container of rows and columns—essentially a table dump. The rename to 'semantic model' highlights that the artifact is far more than raw data: it contains relationships between tables, DAX measures that encode business logic (e.g., year-over-year growth calculations), hierarchies that define drill-down paths, display formatting, and row-level security rules. Together, these elements impose business meaning (semantics) onto otherwise meaningless numbers. The new name signals that the artifact is an active, logic-bearing model—closer to a class definition in object-oriented programming than to a flat file.

Question 2: BASIC CALCULATION

A VertiPaq-compressed semantic model occupies 480 MB of RAM. The raw source data totals 4.8 GB. Calculate the compression ratio and explain why columnar compression is particularly effective for analytical workloads.
Show answer
Using the formula CR = S_raw / S_compressed, we get CR = 4,800 MB / 480 MB = 10:1. Columnar compression is effective for analytical workloads because dimension columns (e.g., country, product category) have low cardinality—many repeated values—which run-length encoding compresses dramatically. Analytical queries typically scan entire columns to compute aggregates (SUM, COUNT) rather than fetching individual rows, so column-oriented storage minimizes I/O by reading only the columns referenced in the query. This access pattern also maximizes CPU cache-line utilization because adjacent values in memory belong to the same column.

Question 3: INTERMEDIATE

You are building a Power BI solution for a hospital. Patient visit data (500K rows/month) lives in a PostgreSQL database. Lab results are in a REST API. A compliance requirement mandates that patient data must never be duplicated outside the hospital's network. Design the architecture: which layers would you use dataflows vs. semantic models, and which connectivity mode would you select for each data source? Justify your choices.
Show answer
Given the compliance constraint, patient visit data cannot be imported into VertiPaq (which would create a copy in Power BI's cloud storage). Therefore, use DirectQuery for the patient visits table, routed through an on-premises data gateway so queries execute against PostgreSQL without data leaving the hospital network. For lab results from the REST API, Power BI DirectQuery does not natively support REST APIs, so create a dataflow to ingest and anonymize/aggregate lab results (removing PII), then import the anonymized entities into the semantic model. The semantic model would be a composite model: DirectQuery for patient visits (compliance), Import for aggregated lab results (performance). DAX measures and RLS rules in the semantic model enforce role-based access so clinicians see only their own patients.

Question 4: APPLIED

A retail company has 12 business units, each with its own Power BI workspace. Currently, every workspace contains a separate .pbix file that independently connects to the same Azure SQL data warehouse, applies slightly different transformation logic, and defines its own revenue measures—leading to conflicting KPI numbers. Propose a refactored architecture using dataflows and shared semantic models to establish a single source of truth. Describe the workspace layout, artifact dependencies, and governance controls.
Show answer
Create a central 'Data Platform' workspace containing a certified dataflow that connects to the Azure SQL data warehouse and standardizes all transformation logic (currency conversion, date parsing, null handling) into clean CDM entities. In the same or a dedicated 'Shared Models' workspace, build a single certified semantic model that imports from the dataflow, defines canonical relationships (star schema), and implements all company-wide DAX measures (Total Revenue, YoY Growth). Apply row-level security so each business unit role sees only its own data. Each of the 12 business-unit workspaces then contains thin report .pbix files that live-connect to the shared semantic model—no embedded data, no duplicated measures. Governance controls include: (1) certifying the semantic model so it appears in the organizational data hub, (2) endorsing the dataflow with a 'promoted' badge, (3) using deployment pipelines (Dev → Test → Prod) for change management, and (4) monitoring refresh health via the Power BI admin APIs. This mirrors the shared-library pattern in software engineering—common business logic lives in one versioned artifact, and consuming applications import it rather than reimplementing it.

Question 5: CRITICAL THINKING

Microsoft Fabric introduces 'Direct Lake' mode, which reads Delta Parquet files directly from OneLake without a full VertiPaq import. Analyze the implications of this mode for the traditional separation between dataflows and semantic models. Does Direct Lake blur the boundary between these abstractions? Could it eventually make dataflows unnecessary? Present arguments for and against, drawing parallels to analogous architectural debates in software engineering (e.g., serverless vs. containers, ORM vs. raw SQL).
Show answer
Direct Lake partially blurs the boundary by eliminating the explicit import step—data written by a dataflow (or Spark notebook) to OneLake is immediately queryable by the semantic model without a refresh cycle. Arguments that Direct Lake makes dataflows less necessary: If a Spark job or Data Factory pipeline already writes clean Delta tables to OneLake, the dataflow's ETL role is redundant; the semantic model can point directly at Lakehouse tables. This parallels the serverless argument: why manage a separate container (dataflow) when the platform (Fabric) handles orchestration? Arguments that dataflows remain valuable: Dataflows provide a low-code Power Query interface accessible to analysts who don't write Spark/SQL, preserving the self-service ethos. They also enforce the CDM schema as a contract—analogous to how an ORM provides a type-safe abstraction over raw SQL, preventing schema drift. Furthermore, separation of concerns remains a sound engineering principle: even if the physical boundary shrinks, the logical boundary between 'data preparation' and 'semantic enrichment' is still meaningful for team ownership and change isolation. The parallel to ORM vs. raw SQL is apt—ORMs didn't eliminate the need for SQL, but they provided an ergonomic layer for common operations. Similarly, dataflows won't disappear; they'll coexist with lower-level tools for different personas and complexity levels.

SUMMARY

Lesson Summary

Summary

Power BI's data architecture separates concerns across three core abstractions. Dataflows are cloud-hosted ETL pipelines that use Power Query (M) to extract, clean, and persist data as reusable entities—either in CDM format (Gen1) or as Delta tables in OneLake (Gen2). Semantic models (formerly datasets) sit atop dataflows and add the business meaning layer: relationships, DAX measures, hierarchies, row-level security, and display formatting. They store data using the VertiPaq columnar engine (Import mode) or forward queries to sources (DirectQuery / Composite modes).

The key architectural insight is separation of concerns: dataflows own extraction and transformation, semantic models own business logic and governance, and reports own visualization. This layered design enables reusability (multiple reports consuming one certified semantic model), independent lifecycle management (ETL logic can change without touching reports), and a single source of truth for KPIs across the organization. Microsoft Fabric extends these concepts with OneLake and Direct Lake mode, reducing data duplication and enabling near-real-time analytics over open Delta tables.

Varsity Tutors • Microsoft Power BI • Datasets, Dataflows & Semantic Models