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.

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.

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.

Visual Explanation — The Data Pipeline

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.

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 = 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.

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

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.

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
Step 1 — Identify Data Sources and Assess Freshness RequirementsList 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
Step 2 — Design Dataflows for Reusable ETLCreate 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
Step 3 — Build the Semantic ModelIn 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
Step 4 — Add Business Logic with DAX MeasuresDefine 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
Step 5 — Publish, Certify, and Connect ReportsPublish 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).

Strengths, Limitations & Trade-Offs

Comparison of Power BI data abstractions by strengths and limitations
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.
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.

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.

Traditional Power BI vs. Microsoft Fabric capabilities
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

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.

Practice Problems

PROBLEM 1CONCEPTUAL
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?
PROBLEM 2BASIC 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.
PROBLEM 3INTERMEDIATE
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.
PROBLEM 4APPLIED
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.
PROBLEM 5CRITICAL 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).

Lesson 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