Lakehouse Analytics in Microsoft Fabric
Build a sales analytics pipeline in Microsoft Fabric using Delta tables and Power BI.
Introduction
30 Second Summary
Imagine a manager asks you for a report on last quarter's sales by city. The data exists somewhere in cloud storage, but getting it into a polished, interactive report takes more than a spreadsheet.
In this project, you will build a complete sales analytics Lakehouse in Microsoft Fabric. You will ingest raw retail data, transform it into a star schema, query it with SQL, and create a live Power BI report, covering core skills tested on the DP-600 certification exam.
What You'll Build
You will open a Power BI report powered by Direct Lake mode, pulling live sales data straight from your Lakehouse so you can explore trends across cities, employees, and time periods.
By the end of this project, you'll have:
- A Lakehouse with real retail data flowing in through a Data Factory pipeline, structured into a star schema of Delta tables you can explore from any Fabric tool.
- Live SQL queries through the SQL analytics endpoint that show sales breakdowns by city, trends by month, and top salespeople.
- An interactive Power BI report powered by a semantic model in Direct Lake mode, pulling data straight from your Lakehouse with no copies or imports.
- Secret Mission: Write a DAX measure that calculates profit margin and add it to your Power BI report.
Are there any prerequisites?
No prior experience with Microsoft Fabric is needed. This project walks you through setting up the free 60-day trial from scratch.
Before We Start
Before you dive in, take a moment to lock in what you are about to build and why it matters. This is your chance to set the direction before any hands-on work begins.
Set Up Your Microsoft Fabric Trial
Everything you build in this project lives inside Microsoft Fabric. Before you can create a workspace or load any data, you need access to the platform itself.
Fabric offers a 60-day free trial with up to 1 TB of OneLake storage. In this step, you will activate the trial, create a workspace, and set up your first Lakehouse.
In this step, get ready to:
- Activate the Microsoft Fabric free trial.
- Create a workspace named Fabric Lakehouse Tutorial.
- Create a Lakehouse named wwilakehouse.
Sign up for Microsoft Fabric and activate the free trial
The Fabric trial gives you 60 days of free access to every Fabric experience. The signup path depends on what kind of Microsoft account you have.
Do you have a work or school Microsoft account (the kind your company or university gives you)? Or do you only have a personal email like Gmail, Outlook.com, or Yahoo?
✔️ I have a work or school Microsoft account
- Open your browser and go to the Fabric portal.
- Sign in with your work or school Microsoft account.
- Select your profile icon in the upper-right corner of the page.
- Select Free trial.
- Choose a capacity region closest to you.
- Select Activate.
After activation, you should see the Fabric portal home page with a left navigation pane showing options like Home, Browse, and Workspaces.
ⓧ I only have a personal email
Fabric requires a work or school identity. You can create one for free through an Azure account. This adds about 5-10 minutes.
First, create a free Azure account:
- Go to the Azure free account page.
- Select Try Azure for free.
- Follow the prompts to create your Azure account. You will need to verify your identity with a phone number and credit card (you will not be charged).
Next, create a user identity in Microsoft Entra ID:
- In the Azure portal, search for Microsoft Entra ID in the top search bar and select it.
- In the left menu, expand Manage and select Users.
- Select + New user, then select Create new user.
- Enter a username and display name. Set a password you will remember.
- Select Review + create, then select Create.
- Copy the user principal name (UPN). It looks like username@yourdomain.onmicrosoft.com.
Now use this identity to activate the Fabric trial:
- Go to the Fabric portal.
- Sign in with the UPN and password you just created.
- Select your profile icon in the upper-right corner.
- Select Free trial.
- Choose a capacity region closest to you.
- Select Activate.
After activation, you should see the Fabric portal home page with the left navigation pane showing options like Home, Browse, and Workspaces.
What is Microsoft Fabric?
Microsoft Fabric is a unified analytics platform that brings together data engineering, data warehousing, data science, and business intelligence. Instead of juggling separate tools for each stage of your data pipeline, Fabric lets you do it all in one place.
The DP-600 certification (Microsoft Certified: Fabric Analytics Engineer Associate) tests your ability to build end-to-end analytics solutions in Fabric.
Don't see the Free trial option?
Make sure you are signed in with a work or school account, not a personal Microsoft account. Personal accounts (Gmail, Outlook.com, Yahoo) cannot activate the trial directly.
If you are using a work account and still do not see the option, your organization's admin may have disabled trials. Try the personal email path in the other tab to create your own Azure-backed identity.
Help me activate my Fabric trial
Create a Fabric workspace
A workspace is the container where all your Fabric items live. Think of it as a project folder that holds your Lakehouse, pipelines, notebooks, semantic models, and reports.
- In the Fabric portal, select Workspaces from the left navigation bar.
- Select + New workspace at the bottom of the pane that opens.
- In the Name field, enter Fabric Lakehouse Tutorial.
- Expand the Advanced section.
- Under Workspace type, select Fabric Trial capacity.
- Select Apply to create and open the workspace.
You should see your new Fabric Lakehouse Tutorial workspace open with an empty item list and a toolbar at the top.
Why Fabric Trial capacity?
Setting the workspace type to Fabric Trial assigns your trial's compute resources to this workspace. Without this, Fabric items like Lakehouses and Spark notebooks cannot run because they need dedicated compute capacity.
Don't see Fabric Trial under Workspace type?
Make sure you activated the free trial in the previous substep. If the trial is not active, the Fabric Trial option does not appear under Workspace type.
Help me set up my Fabric workspace
Create a Lakehouse
A Lakehouse combines the flexibility of a data lake with the structure of a data warehouse. It stores both raw files and structured Delta Lake tables in a single location powered by OneLake.
- From the Fabric Lakehouse Tutorial workspace, select + New item.
- In the search box, type Lakehouse and select Lakehouse from the results.
- In the New lakehouse dialog, enter wwilakehouse in the Name field.
- Leave the Lakehouse schemas checkbox selected. This organizes your tables into logical groups, which the transformation notebook in the next steps depends on.
- Select Create.
What is a Lakehouse?
A Lakehouse gives you two storage sections. Files holds raw, unstructured data like CSVs and parquet files. Tables holds structured Delta Lake tables that you can query with SQL or Spark.
Both sections are backed by OneLake, which makes the data accessible to every Fabric engine (pipelines, notebooks, SQL, Power BI) without copying it.
What do you expect to see when the Lakehouse opens for the first time?
The Lakehouse opens in the Explorer view with two empty sections: Tables and Files. Both are empty because you have not ingested any data yet. That is exactly what you will do in the next step.
Don't see the Lakehouse option in New item?
Make sure your workspace is set to Fabric Trial capacity. Lakehouses require a Fabric capacity to run. Open your workspace settings and verify the Workspace type is set correctly.
Help me create my Lakehouse
Your environment is ready. You have an active Fabric trial, a workspace, and an empty Lakehouse waiting for data. Next up, you will build a Data Factory pipeline to ingest real retail data into your Lakehouse.
Ingest Raw Data with a Pipeline
Your Lakehouse is created and ready to go. Right now, though, the wwilakehouse is completely empty. Before you can transform or query anything, you need actual data to work with.
In this step, you'll create a Data Factory pipeline to pull retail sales data from Azure Blob Storage into your Lakehouse. Data ingestion with pipelines falls under the "Prepare data" section of the DP-600 exam, which makes up 45-50% of the test.
In this step, get ready to:
- Create a Data Factory pipeline with a Copy Data activity.
- Configure the source and destination connections for the pipeline.
- Run the pipeline and verify the ingested data appears in your Lakehouse.
Create a Data Factory pipeline
A Data Factory pipeline automates moving data from one place to another. You'll build one that copies raw sales files from a public Azure Blob Storage account into your Lakehouse.
- Select Workspaces in the left navigation bar.
- Select Fabric Lakehouse Tutorial to return to your workspace.
- Select New item.
- Search for Pipeline and select it.
- Enter IngestDataFromSourceToLakehouse in the Name field.
- Select Create.
The pipeline editor opens with an empty canvas. Now you need to add an activity that tells the pipeline what work to do.
- From the pipeline's Home tab, select Pipeline activity.
- Select Copy data.
- On the General tab of the activity properties pane at the bottom, enter Data Copy to Lakehouse in the Name field.
What is a Copy Data activity?
A Copy Data activity is the building block of your pipeline. It defines where to read data from (the source), where to write it to (the destination), and how to move it. You'll configure both sides next.
Configure the source connection
The source is a public Azure Blob Storage account that Microsoft hosts with sample retail data from the Wide World Importers dataset. You'll point your pipeline at it using an anonymous connection.
- Select the Source tab in the activity properties pane.
- Select the Connection dropdown.
- Select Browse all.
- Search for Azure blobs and select it.
- In the Account name or URL field, enter https://fabrictutorialdata.blob.core.windows.net/sampledata/.
- In the Connection name field, enter wwisampledata.
- Set Authentication kind to Anonymous.
- Select Connect.
Why anonymous authentication?
This Azure Blob Storage account is publicly accessible sample data hosted by Microsoft. Anonymous authentication means no credentials are needed. In a real project, you would use a service principal or managed identity instead.
The connection dialog closes and you're back on the Source tab. Now you need to tell the pipeline exactly which files to copy.
- Set File path type to File path.
- In the first text box (container name), enter sampledata.
- In the second text box (directory name), enter WideWorldImportersDW/parquet.
- Check the Recursively checkbox.
- Set File format to Binary.
What do these file path settings do?
You're pointing the pipeline at a specific container (sampledata) and a directory inside it (WideWorldImportersDW/parquet) that holds parquet files. Checking Recursively ensures every subfolder gets copied too.
Binary format copies the files exactly as they are, with no conversion. You'll transform them into structured tables in the next step.
Connection failing?
Double-check that the URL in the Account name or URL field is exactly https://fabrictutorialdata.blob.core.windows.net/sampledata/ with no extra spaces. Make sure Authentication kind is set to Anonymous, not Shared Access Signature or any other option.
Help me troubleshoot my Azure Blob Storage connection in Microsoft Fabric
Configure the destination and run the pipeline
The source is ready. Now you need to tell the pipeline where to put the copied files inside your Lakehouse.
- Select the Destination tab.
- Set Connection to wwilakehouse.
- Set Root folder to Files.
- In the first text box (directory name), enter wwi-raw-data.
- Set File format to Binary.
Why land the data in Files instead of Tables?
A Lakehouse has two storage areas. Files holds unstructured or raw data. Tables holds structured Delta Lake tables that SQL and Power BI can query.
You're landing raw parquet files in Files first. In the next step, you'll transform them into proper Delta tables and move them to Tables.
Your pipeline is fully configured. Time to run it.
- Select Save on the ribbon.
- Select Run.
What to expect while the pipeline runs
The Output tab at the bottom of the pipeline editor shows the run status. You'll see the status change from Queued to In progress to Succeeded. This takes about a minute.
- Monitor the Output tab and wait until the status shows Succeeded.
Before you check the Lakehouse, what do you expect to see in the Files section of wwilakehouse? Think about what folder name you configured as the destination.
- Select Workspaces in the left navigation bar.
- Select Fabric Lakehouse Tutorial.
- Select wwilakehouse to open it.
- In the Explorer pane, expand the Files section. If you do not see any folders, select the Refresh icon at the top of the Explorer pane.
You should see a wwi-raw-data folder under Files. Expand it to see subfolders containing parquet files: fact_sale_1y_full, dimension_city, dimension_customer, and more.
Don't see the wwi-raw-data folder?
Make sure you expanded Files, not Tables. The raw data lands in Files because you selected it as the root folder in the destination settings.
If Files is still empty after refreshing, return to the pipeline and check that the status in the Output tab shows Succeeded. If it shows Failed, select the error to see details and verify your source URL and destination directory match exactly what you configured above.
Help me troubleshoot my Data Factory pipeline run in Microsoft Fabric
Your Lakehouse has real data in it now. Next up, you'll transform these raw parquet files into a star schema of structured Delta tables that SQL and Power BI can query directly.
Transform Data into a Star Schema
Your pipeline successfully loaded raw retail data into wwilakehouse. The Files section now holds Wide World Importers parquet files ready for transformation.
No engine in Microsoft Fabric can query those raw parquet files as tables. In this step, you will transform them into structured Delta Lake tables organized as a star schema using a pre-built PySpark notebook.
In this step, get ready to:
- Import a PySpark notebook from GitHub and link it to wwilakehouse.
- Run notebook cells to create a star schema of Delta tables (one fact table and five dimension tables).
- Build two aggregate tables for faster analytics queries.
Import the transformation notebook
Microsoft provides a pre-built PySpark notebook that reads raw parquet files and writes them as structured Delta tables. You will download this notebook from GitHub, import it into your workspace, and link it to your Lakehouse.
- Download the Prepare and transform data - PySpark.ipynb file from the Lakehouse Tutorial Source Code folder on GitHub.
- Click the file name in the file list, then select the download icon in the upper-right corner of the file view to save it to your computer.
What is a star schema?
A star schema organizes data into two types of tables. A fact table holds measurable events like sales transactions with quantities, prices, and profit. Dimension tables describe the context around each event: where it happened, who was involved, and when it occurred.
The fact table sits at the center and connects to each dimension table through shared keys. This layout makes it fast and intuitive to slice data by city, customer, employee, or date.
- Return to the Fabric Lakehouse Tutorial workspace in the Fabric portal.
- Select Import, then Notebook, then From this computer.
- Upload the downloaded Prepare and transform data - PySpark.ipynb file.
After the import completes, you should see the notebook listed as a new item in your workspace.
- Select wwilakehouse from the workspace items to return to your Lakehouse.
- Select Open notebook from the top navigation menu.
- Select Existing notebook.
- Select the Prepare and transform data - PySpark notebook from the list.
The notebook opens with the Lakehouse explorer panel on the left showing wwilakehouse. This confirms the notebook is linked to your Lakehouse and can read from and write to it.
Don't see the notebook in the list?
Make sure the import completed successfully by checking for the notebook item in your workspace. If it is missing, try the import again using Import > Notebook > From this computer.
Help me link my notebook to the Lakehouse in Microsoft Fabric.
Run the notebook cells to create Delta tables
The notebook contains pre-written Spark code split across multiple cells. You will run each cell one at a time to configure the session and create the star schema tables.
- Run Cell 1 by hovering over it and selecting the Run cell button, or by pressing Shift+Enter.
What does Cell 1 do?
Cell 1 configures the Spark session with two optimizations. V-Order organizes data for faster reads in Fabric. Optimize Write reduces the number of small files written to storage.
Running this cell also starts the Fabric Live Pool Spark session, which may take a few seconds to spin up.
- Run Cell 2 to create the fact_sale table. This cell reads the raw parquet data from Files/wwi-raw-data/full/fact_sale_1y_full, adds Year, Quarter, and Month columns, and writes a Delta table partitioned by Year and Quarter.
Cell 2 may take a minute or two to complete since it processes the largest dataset.
Use Path 1 in the notebook
The notebook contains two code paths: Path 1 (for lakehouse schemas enabled) and Path 2 (for schemas not enabled). Since you created wwilakehouse with the Lakehouse schemas checkbox selected, you must use Path 1. Run only the Path 1 cells and skip any cells marked as Path 2.
- Run Cell 3 to create the five dimension tables: dimension_city, dimension_customer, dimension_date, dimension_employee, and dimension_stock_item.
- Right-click wwilakehouse in the notebook's Lakehouse explorer and select Refresh.
You should see six tables listed under Tables: fact_sale, dimension_city, dimension_customer, dimension_date, dimension_employee, and dimension_stock_item. These are the core tables of your star schema.
What tables did you just create?
The fact_sale table is the center of your star schema. Each row represents a sales transaction with quantities, prices, and profit values.
The five dimension tables describe the who, where, and when of each sale. For example, dimension_city maps a CityKey to a city name and state, and dimension_date maps a date key to calendar attributes like month and year.
Don't see all six tables?
Check that each cell finished without errors. A red error banner below a cell means it failed. Re-run the failed cell before continuing.
If you accidentally ran a Path 2 cell, the table may have been written to a different location. Right-click wwilakehouse and select Refresh again to check.
Help me troubleshoot my notebook cells in Microsoft Fabric.
Create aggregate tables
Aggregate tables pre-compute common summaries so that reports and queries run faster. The remaining cells join fact and dimension data, then group the results into ready-made summary tables.
- Run Cell 4 to load the Delta tables you just created into Spark DataFrames.
- Run Cell 5 to join fact_sale with dimension_date and dimension_city, aggregate the sales data, and write the aggregate_sale_by_date_city table.
- Run Cell 6 to join fact_sale with dimension_date and dimension_employee, aggregate, and write the aggregate_sale_by_date_employee table.
What are aggregate tables?
Instead of joining millions of fact rows with dimension rows every time you run a query, aggregate tables store the joined and summarized result. This means a report showing total sales by city and date can read directly from aggregate_sale_by_date_city without recalculating every time.
Before you refresh, think about how many tables you expect to see now. Count the fact table, the dimension tables, and the two aggregate tables you just created.
- Right-click wwilakehouse in the notebook's Lakehouse explorer and select Refresh.
You should see eight tables listed under Tables: the original six star schema tables plus aggregate_sale_by_date_city and aggregate_sale_by_date_employee.
Missing the aggregate tables?
Cell 4 must complete before Cells 5 and 6 can run successfully, because it loads the DataFrames that the later cells depend on. If Cell 5 or 6 failed, re-run Cell 4 first, then re-run the failed cell.
Help me fix my aggregate table cells in Microsoft Fabric.
Your star schema is complete. You have a fact table, five dimension tables, and two aggregate tables ready for analysis. Next up, you will query this data using SQL to see what it actually contains.
Query Your Data with SQL
You now have a complete star schema sitting in your Lakehouse. Eight Delta tables are loaded and ready.
But you have not actually seen the data inside those tables yet. The fact_sale table stores numeric keys like CityKey and SalespersonKey that are meaningless on their own. Querying with SQL through the SQL analytics endpoint is how analysts explore Lakehouse data in practice. It is also directly tested on the DP-600 exam, where the "Prepare data" section covers 45-50% of the test.
In this step, get ready to:
- Open the SQL analytics endpoint for your Lakehouse.
- Write and run a SQL query joining fact and dimension tables.
- Explore your data across different dimensions.
Open the SQL analytics endpoint
The SQL analytics endpoint gives you a SQL-based view of your Lakehouse tables. It lets you write and run queries against your Delta Lake tables without spinning up a Spark session.
- Return to the wwilakehouse lakehouse in the Fabric portal.
- Select SQL analytics endpoint from the Lakehouse dropdown menu at the top right of the screen.
- In the SQL analytics endpoint pane, confirm you can see all eight tables you created. If you do not see them, select the Refresh icon at the top left.
What is the SQL analytics endpoint?
Every Lakehouse in Microsoft Fabric automatically provides a SQL analytics endpoint. It exposes your Delta tables as SQL tables you can query with standard T-SQL.
You do not need to copy or move the data. The endpoint reads directly from the same OneLake storage your Lakehouse uses.
Write and run a SQL query
Before you join tables, take a quick look at what raw fact data looks like on its own. The fact_sale table stores foreign keys as integers. Without joining to dimension tables, a column like CityKey is just a number with no context.
- Select New SQL query from the ribbon.
- Peek at the raw data by pasting and running this query:
-- Preview raw fact_sale data to see what foreign keys look like
SELECT TOP 10
CityKey,
SalespersonKey,
TotalIncludingTax
FROM fact_sale
You see rows of numbers. CityKey might be 36 or 114. Which city is that? You have no idea from the fact table alone.
This is exactly why dimension tables exist. Joining fact_sale to dimension_city replaces those opaque keys with real city names.
- Select New SQL query from the ribbon again to open a fresh query tab.
- Paste and run this query that joins fact_sale with dimension_city:
-- Join fact_sale with dimension_city to see sales totals by city
SELECT
dc.City,
dc.StateProvince,
SUM(fs.TotalIncludingTax) AS TotalSales
FROM fact_sale AS fs
INNER JOIN dimension_city AS dc
ON fs.CityKey = dc.CityKey
GROUP BY dc.City, dc.StateProvince
ORDER BY TotalSales DESC
What does this query do?
- INNER JOIN connects each row in fact_sale to the matching city in dimension_city using the shared CityKey column.
- SUM(fs.TotalIncludingTax) adds up the total sales amount for each city.
- GROUP BY groups the results by City and StateProvince so you get one row per city.
- ORDER BY TotalSales DESC sorts the results so the highest-revenue cities appear first.
You now see real city names alongside their total sales. Compare that to the meaningless key numbers from the first query.
Not seeing any results?
- Make sure you selected Run (the play button) at the top of the query editor.
- Check that the table names match exactly: fact_sale and dimension_city. Capitalization matters.
- If tables are missing, return to the Lakehouse view and confirm all eight tables appear under Tables.
Having trouble with your query?
Explore the data further
Your star schema has five dimension tables. Each one unlocks a different way to slice the sales data.
- Open a new query tab by selecting New SQL query from the ribbon.
- Explore sales by month by pasting and running this query that joins fact_sale with dimension_date:
-- Join fact_sale with dimension_date to see sales by month
SELECT
dd.[Calendar Year] AS CalendarYear,
dd.[Calendar Month Label] AS MonthLabel,
SUM(fs.TotalIncludingTax) AS TotalSales
FROM fact_sale AS fs
INNER JOIN dimension_date AS dd
ON fs.InvoiceDateKey = dd.Date
GROUP BY dd.[Calendar Year], dd.[Calendar Month Label]
ORDER BY CalendarYear, TotalSales DESC
Why the square brackets?
Column names like Calendar Year and Calendar Month Label contain spaces. In T-SQL, you wrap column names that contain spaces in square brackets so the query engine reads them as a single identifier.
The results show total sales broken down by year and month. You can spot seasonal patterns in the Wide World Importers data.
- Open one more query tab by selecting New SQL query from the ribbon.
- Find the top salespeople by pasting and running this query that joins fact_sale with dimension_employee:
-- Join fact_sale with dimension_employee to find top salespeople
SELECT TOP 10
de.Employee,
de.PreferredName,
SUM(fs.TotalIncludingTax) AS TotalSales
FROM fact_sale AS fs
INNER JOIN dimension_employee AS de
ON fs.SalespersonKey = de.EmployeeKey
GROUP BY de.Employee, de.PreferredName
ORDER BY TotalSales DESC
You now see which employees drive the most revenue. The PreferredName column gives a friendly display name for each salesperson.
What is the Visual Query Editor?
The SQL analytics endpoint also includes a Visual Query Editor that lets you build queries by dragging tables onto a canvas instead of writing SQL. Select New visual query from the ribbon to try it.
Drag fact_sale and a dimension table onto the canvas. The editor auto-detects relationships and lets you pick columns and aggregations visually.
Before you move on, think about what you just proved. Do you think SQL queries alone are enough to share these insights with stakeholders who do not write SQL?
You confirmed that all six of your star schema tables join correctly and return meaningful sales data. SQL is powerful for exploration, but stakeholders need dashboards and visuals they can interact with. That is exactly what you will build next.
Seeing an error in one of your queries?
- Double-check that column names with spaces are wrapped in square brackets, such as [Calendar Year].
- Verify the join key matches the verified mappings: InvoiceDateKey joins to dimension_date.Date, and SalespersonKey joins to dimension_employee.EmployeeKey.
- Make sure each query runs in its own tab. Running multiple queries in one tab can cause unexpected results.
Need help debugging a SQL error?
Your star schema works. You can slice sales by city, by month, and by salesperson. Next up, you will build a semantic model that defines these relationships permanently and create a Power BI report so anyone can explore this data visually.
Build a Semantic Model and Power BI Report
In the previous step, you queried your star schema with SQL and saw real sales data grouped by city, date, and employee. SQL queries are powerful for analysts, but stakeholders need interactive visual reports they can explore on their own.
In this step, you will create a semantic model that defines the relationships between your fact and dimension tables, then build a Power BI report on top of it. This maps directly to the DP-600 "Implement and manage semantic models" section, which covers 25-30% of the exam.
In this step, get ready to:
- Create a semantic model from the SQL analytics endpoint.
- Define relationships between your fact and dimension tables.
- Build a Power BI report with a sales visualization.
Create a semantic model
A semantic model is a layer that sits between your raw data and your reports. It defines which tables are available and how they relate to each other, so Power BI can build meaningful visualizations.
- Return to the SQL analytics endpoint view of the wwilakehouse. If you navigated away, open the wwilakehouse lakehouse from the Fabric Lakehouse Tutorial workspace and select SQL analytics endpoint from the Lakehouse dropdown menu at the top right.
- Select New semantic model from the ribbon.
- In the New semantic model dialog box, enter WWI Sales Model in the name field.
- Select the workspace to save it in (use Fabric Lakehouse Tutorial).
- Select all eight tables: fact_sale, the five dimension tables, and the two aggregate tables.
- Select Confirm.
The semantic model is created and the web modeling experience opens, showing your tables.
What is Direct Lake mode?
When you create a semantic model from a Lakehouse, it uses Direct Lake mode. This loads data directly from OneLake into memory for fast analysis without importing or duplicating data.
Traditional Power BI imports require a separate copy of your data. Direct Lake skips that copy entirely, so your reports always reflect the latest data in your Lakehouse.
Don't see all eight tables?
If tables are missing, go back to the SQL analytics endpoint pane and select the Refresh icon at the top left. Then try creating the semantic model again.
If you see an error about accessing Delta tables, the tables may not be registered in the Spark metastore. Return to your notebook and re-run the cells that create the tables.
help me troubleshoot missing tables in my semantic model
Define table relationships
Your semantic model has all the tables, but Power BI does not yet know how they connect. You need to define relationships so that filtering by a city or date in a report automatically filters the matching sales.
- Go to your workspace by selecting Fabric Lakehouse Tutorial in the left navigation.
- Select the WWI Sales Model semantic model to open it.
- Select Open from the toolbar to open the web modeling experience.
- In the top right corner, select the dropdown and choose Editing.
You are now in the model editor where you can see your tables laid out on a canvas. Time to connect them.
- From the fact_sale table, drag the CityKey field to the CityKey field in the dimension_city table.
- In the New relationship dialog, verify Cardinality is set to Many to one (*:1).
- Verify Cross filter direction is set to Single.
- Check the Assume referential integrity box.
- Select Save.
A relationship line now connects fact_sale to dimension_city on the canvas.
Why Many to one?
Each row in fact_sale records a single sale that happened in one city. But the same city appears in many sales. That is a many-to-one relationship: many sales map to one city.
The Assume referential integrity setting tells the engine that every CityKey in fact_sale has a matching row in dimension_city. This allows Direct Lake to use more efficient queries.
Now repeat the same process for the remaining four dimension tables. Each relationship uses the same settings: Many to one (*:1), Single cross filter, and Assume referential integrity checked.
- Drag StockItemKey from fact_sale to StockItemKey in dimension_stock_item. Verify the settings and select Save.
- Drag SalespersonKey from fact_sale to EmployeeKey in dimension_employee. Verify the settings and select Save.
- Drag CustomerKey from fact_sale to CustomerKey in dimension_customer. Verify the settings and select Save.
- Drag InvoiceDateKey from fact_sale to Date in dimension_date. Verify the settings and select Save.
Why must fact_sale always be the From table?
When defining relationships, fact_sale must always be the From table and the dimension table must be the To table. This ensures filters flow from the dimension (the descriptive context) into the fact (the measurable events), which is how star schema queries work.
If you accidentally drag from the dimension table to the fact table, the relationship direction reverses and your report filters will not work correctly. Check the New relationship dialog to confirm the From and To tables before saving.
You should now see five relationship lines radiating from fact_sale to each of the five dimension tables on the canvas.
Relationship lines not showing?
Make sure you selected Editing from the dropdown in the top right. In view-only mode, you cannot create or see relationship lines.
If a relationship shows an error, check that you dragged from fact_sale (the From table) to the dimension table (the To table), not the other way around.
help me fix relationship errors in my semantic model
Create a Power BI report
With your semantic model and relationships in place, you can now build a visual report. This is the payoff: stakeholders can explore your data interactively instead of running SQL queries.
- From the semantic model view, select New report in the ribbon.
A new browser tab opens with the Power BI report canvas. You will see a blank canvas with a Visualizations pane on the right and a Data pane listing your tables.
- In the Visualizations pane, select the Clustered column chart icon. Power BI adds an empty chart placeholder to the canvas.
- In the Data pane, expand the dimension_city table and drag City to the X-axis field well in the Visualizations pane.
- In the Data pane, expand the fact_sale table and drag TotalIncludingTax to the Y-axis field well.
Before you look at the result, what do you think the chart will show? Which cities do you expect to have the highest sales?
The chart renders columns for each city, with the height representing the sum of TotalIncludingTax. You can hover over any column to see the exact value.
What does this visualization show?
The column chart aggregates all sales transactions by city. Power BI automatically sums TotalIncludingTax for each unique city value. This works because the relationship you defined between fact_sale.CityKey and dimension_city.CityKey tells Power BI how to join the tables.
The data flows directly from your Delta tables in OneLake through Direct Lake mode. No data was imported or copied to build this chart.
- Save the report by selecting File then Save.
- When prompted, save the report to the Fabric Lakehouse Tutorial workspace.
Chart showing no data?
Make sure you dragged City to the X-axis field well and TotalIncludingTax to the Y-axis field well. If the fields landed in the wrong wells, drag them to the correct ones.
If you see an error about the data source, return to the semantic model and verify all five relationships are saved correctly.
help me fix my Power BI column chart that shows no data
Your analytics pipeline is complete. Raw data flows from Azure Blob Storage into your Lakehouse, gets transformed into a star schema, and now powers a live Power BI report through Direct Lake mode. In the Secret Mission, you will push further by writing a custom DAX measure to add calculated values to your report.
Secret mission
Add a DAX Measure to Your Report
Your report shows raw sales totals, but stakeholders want derived metrics like profit margin that do not exist as columns in the data. In this mission, you will write a DAX measure using the DIVIDE function, format it as a percentage, and add it to a new visualization in your Power BI report.
Clean Up Your Resources
Clean Up Your Resources
This project runs entirely on Microsoft Fabric's 60-day free trial, so there are no ongoing costs during the trial period. Decide whether to keep your resources running, pause them to come back later, or delete them entirely.
Resources you used:
- Workspace Fabric Lakehouse Tutorial (contains all items below).
- Lakehouse wwilakehouse with eight Delta tables and raw data files.
- Pipeline IngestDataFromSourceToLakehouse.
- Notebook Prepare and transform data - PySpark.ipynb.
- Semantic model WWI Sales Model with five relationships and a DAX measure.
- Power BI report with sales visualizations.
Keep everything running
No action needed. Choose this if you are still actively building or exploring Fabric features for DP-600 prep.
- Your workspace, lakehouse, semantic model, and reports stay available for the remainder of your 60-day trial.
- Use the time to write more SQL queries, add visualizations to your report, or experiment with additional DAX measures.
- Your Microsoft Fabric trial account remains active until the 60-day period ends.
Pause - I'll come back to this later
No action needed. The Fabric trial does not charge you, and all resources remain available until the trial expires.
- Your workspace and everything inside it stays intact for the full 60-day trial period.
- When you are ready to return, sign in at https://app.fabric.microsoft.com and open the Fabric Lakehouse Tutorial workspace.
Delete - I don't want to use this again
Remove all project resources by deleting the workspace. This permanently deletes everything inside it, including the lakehouse, pipeline, notebook, semantic model, and reports.
- In the Fabric portal, open the Fabric Lakehouse Tutorial workspace.
- Select the workspace settings by clicking the gear icon.
- Scroll to the bottom of the settings panel.
- Select Remove this workspace.
- Confirm the deletion when prompted. This permanently removes the workspace and all its contents.
What about the Fabric trial?
Deleting the workspace does not cancel your Fabric trial. The trial continues until the 60-day period ends, so you can create new workspaces and try other Fabric features at any time.
Nice Work!
Nice Work!
You just built a complete sales analytics pipeline in Microsoft Fabric. Raw retail data went in, and a live Power BI report came out.
You've learned how to:
- Ingested raw retail data from Azure Blob Storage into a Lakehouse using a Data Factory pipeline, then transformed it into a star schema of Delta tables using a PySpark notebook.
- Queried your Lakehouse data through the SQL analytics endpoint to verify that fact and dimension tables join correctly and return meaningful sales data.
- Built a semantic model with defined relationships between fact and dimension tables, then created a Power BI report visualizing sales data directly from the Lakehouse using Direct Lake mode.
- Secret Mission: Wrote a DAX measure (Profit Margin) and added it to your report to display calculated percentage values.
Ready to quiz yourself?