Power BI
Topic 6 of 14 · In Data Analysis · September 8, 2026
From cleaned data to interactive dashboards: Power Query, the star-schema model, DAX measures, visuals and publishing with refresh.
Overview
Power BI is where the cleaned data from your previous topics becomes something a business can use: an interactive report a manager can filter, drill into, and refresh every morning. It is the most-wanted dashboard tool in current analyst job ads, and it rewards exactly the skills you already built — Excel logic, SQL-style joins and aggregations carry over almost one-to-one.
The mental shift this topic demands is the big one of the whole path: you stop analyzing cells and start modeling relationships between tables, then you write measures (DAX) that stay correct no matter how the user slices the report. Master that, and Power BI feels less like charting software and more like building a small analytics product.
Before You Start
- Complete the Data Cleaning topic first, because your Power Query steps here reuse that exact workflow.
- Load the cleaned sales export (order date, region, category, product, salesperson and amount) and build separate customers, products and Date reference tables before modelling.
- Refresh the SQL joins you practised: a Power BI relationship is a JOIN with a filter direction, so you already know the idea.
- Be able to hand-calculate one month's total revenue from the raw data, because you will verify every DAX measure against it.
- Get Power BI Desktop installed, or confirm your Excel's Power Query is current, before the lesson.
Learning Objectives
- Explain Power BI's architecture: Desktop (build) vs Service (share/refresh)
- Connect and transform data with Power Query, reusing your cleaning skills as steps
- Shape the data into a star schema with fact and dimension tables
- Manage relationships and their cardinalities and filter directions
- Write DAX measures instead of calculated columns, using the engine's filter context
- Use core DAX patterns: totals, ratios, percent-of-total, period-over-period, running totals, TOPN
- Choose and format visuals that answer one question each
- Design a clean, usable, accessible report page
- Publish to the service, set a scheduled refresh, and manage access with RLS
- Iterate a report from rough to polished with stakeholder feedback
Prerequisites
Basics, Excel, SQL and Data Cleaning — Power Query and DAX assume you understand joins, aggregation and clean tables. Statistics vocabulary (percentiles, outliers) helps when choosing visuals.
What Power BI Is, and Where It Fits
Power BI has two halves. Power BI Desktop (a free Windows app) is where you build — connect data, transform it, model it, design visuals. Power BI Service (cloud) is where you publish a finished report so colleagues view it, and where you schedule refresh so the numbers stay current without you re-clicking anything.
Your workflow is always the same four rooms, left to right: Get Data → Transform (Power Query) → Model (relationships) → Report. Later you add publish & refresh. If Excel was your scratchpad and SQL your query engine, Power BI is the production display where the business actually watches the scoreboard.
Power Query: Cleaning That Replays
Power Query is your data-cleaning topic made reusable: every click you make — rename, remove columns, split, merge, filter, change type — becomes a step in a list that replays on every refresh. Because it is the same engine inside Excel and Power BI, everything you learned in Data Cleaning applies verbatim.
- Connect to files, folders, databases and web sources via Get Data
- Append = stack tables (your regional exports); Merge = join tables (your SQL JOIN here)
- Do the last step for most columns: set the correct type. The wrong type at the end silently breaks your model.
Good hygiene: never write a hack transform inside a visual — every permanent change belongs in Power Query steps, which are the versioned, repeatable history of your cleaning.
The Data Model: Think Star, Not Spreadsheet
The most important habit in Power BI: a flat mega-table is a trap. Instead, split your data into a star schema:
- Fact table — the measurement events (orders: row = one order, with numeric facts and key columns)
- Dimension tables — the descriptive context (customers, products, dates/calendar) that you slice by
One simple pattern: orders (fact) sits in the middle; customers, products and a Date calendar join to it. This avoids duplicated description (customer name repeated on every order row), shrinks file size, and — crucially — makes DAX aggregations fast and predictable.
Build a proper Date/Calendar table (a table of dates spanning your data, each with year/month/quarter) and link it to your fact's date column. Almost every professional measure needs it.
Relationships and Filter Flow
A relationship connects two tables on a key column and defines how filtering flows from one to the other. Get three things right and you can forget about it:
- Cardinality — most are one-to-many: one product (the "one" side) → many order lines (the "many" side)
- Filter direction — filters flow from the dimension (product) to the fact (orders) via the arrow; that is what lets you "slicer, then see orders"
- Single direction for 95% of cases — bidirectional arrows exist but create ambiguity; avoid unless you truly understand why
Test your model like this: put product category and total sales on a visual, apply a filter, and confirm the result drops the way the business expects. If it does not, the relationship — not the DAX — is usually guilty.
Measures vs Calculated Columns
Here is the mental model that separates a Power BI user from an analyst who designs with it. A calculated column is baked at load time, once per row (like adding a column in Excel). A measure is evaluated at query time for whatever slice the report currently shows.
Total Revenue = SUM( orders[amount] ) Revenue per Order = DIVIDE( [Total Revenue], COUNTROWS( orders ) )
Because a measure reacts to the current filter context — the slicer, the row, the page — the same measure is correct at every level: total, per month, per region, per product. That is the core Power BI advantage and the thing interviewers probe. Rule of thumb: write measures for numbers and ratios; use calculated columns only for static row-level attributes (e.g. "High / Medium / Low" buckets).
DAX Patterns You Will Use Weekly
A small set of patterns covers nearly all analyst asks. All are measures over a star model:
-- Percent of total
Revenue % of Total = DIVIDE([Total Revenue], CALCULATE([Total Revenue], ALL( products )))
-- vs previous year, with time intelligence
Revenue vs PY = [Total Revenue] - CALCULATE([Total Revenue], SAMEPERIODLASTYEAR( dates[Date] ))
-- 12-month rolling total
Revenue rolling 12M = CALCULATE([Total Revenue],
DATESINPERIOD( dates[Date], MAX( dates[Date] ), -12, MONTH ))
-- Top 5 products by revenue
Top 5 Revenue = CALCULATE([Total Revenue],
TOPN( 5, products, [Total Revenue] ))CALCULATEis the one function to master — it re-writes the current filter context before evaluating its measureALL()removes filters (percent-of-total);ALLSELECTED()respects the page slicers- Time intelligence needs the Date table linked to your fact
Write each pattern once, verify against a hand-calculated number, and you will have a personal measure library you reuse in every report.
1. Name measures clearly (Total Revenue, not M1).
2. Put every measure in one 'Measures' table.
3. Verify vs quarterly numbers before styling anything.Visuals That Answer Questions
Every visual on a page should answer one question — if it does not survive the "so what?" test, it is decoration. The practical menu:
- KPI card — single headline number (+ vs target or prior period)
- Line/area — trends over time; group by month/quarter
- Bar/column — comparison/ranking (top regions, categories); horizontal bars for long labels
- Pie/donut — only for a few slices that sum to a meaningful whole; prefer bars otherwise
- Matrix/table — exact numbers and drill-downs (year → quarter → month)
- Slicers — the filters your audience will actually use
Interactivity: slicers, drill-down on matrices (year → month), drill-through pages (region page from a detail page), and clearly labeled tooltips make a report feel alive without overwhelming the main page. Formatting rule: one accent color for the "star" number, neutral grays for context, no rainbow.
Designing the Report Page
A dashboard that works in a meeting reads top-to-bottom, left-to-right, one decision per page:
- Title + as-of date up top (the audience must know how fresh it is)
- Row of KPI cards — the scoreboard first
- Then the trend (what happened over time)
- Then breakdowns (by region, product, channel) and the cross-filter slicers
Use a 12-column grid, alignment guides, consistent fonts and spacing. Every slicer and visual gets a label. Then the professional move: look at it on a small screen — most consumers will — and in black-and-white print, to catch low-contrast crimes.
Publishing, Refresh and Row-Level Security
The report only matters if people can see current numbers. Publish to the Service, then set: scheduled refresh (daily/ hourly from your data sources — the point of your reproducible cleaning; it now runs itself) and permissions. Two security layers are worth knowing:
- App workspaces + sharing — who can view/edit the report
- Row-Level Security (RLS) — same report, filtered per role (a regional manager sees only their region). Implement with a small role table + DAX filtering rules, enabled in the Service
Finish with a short data dictionary / refresh note tab inside the report file (or a linked doc): sources, refresh schedule, and definitions of the key measures. Self-serve analytics means the consumer can also understand what they are looking at.
Hands-On Practice
Use a superstore-style CSV (you can reuse your cleaned data-cleaning output).
- Import it, then split it into orders (fact) + customers, products and a Date table (dimensions) in Power Query.
- Create the relationships and verify filter flow by slicing total revenue by category.
- Write the DAX patterns above and check each against a hand-calculated PivotTable number.
- Build a two-page report: a monthly KPI page (cards, trend, category bar, region matrix, slicers) and a drill through page for one region.
- Publish a copy to the Service and document the refresh plan.
Get Data + Power Query transforms (reuse cleaning steps), build the star schema and Date table, create and test relationships. This is the foundation week — an hour here saves ten in DAX.
Deeper Worked Examples
A revenue measure that stays right under any slice
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Common Mistakes
- Building on one flat table and then fighting DAX filter surprises
- No Date table — then "vs last year" measures fail or lie
- Writing long-calculated columns for numbers that should be measures
- Using SUM(a/b) instead of DIVIDE and getting blanks/errors
- Bidirectional relationships to "be safe" and creating ambiguous filters
- Rainbow dashboards with a different color per series and no hierarchy
- Ignoring the as-of date — dashboards silently showing stale numbers
- Forgetting RLS and sharing the raw dataset instead of the report
Real-World Usage
Analyst job ads ask for Power BI more than any other dashboard tool, and the interviews typically include a "build me a report" task. What they evaluate is not visual flair — it is whether you model the data properly, write measures that hold up under any filter, and keep the business logic (the as-of date, the definitions) visible. In daily work, Power BI is where your SQL and cleaning skills turn into the thing managers actually look at on Monday mornings; a good model is the difference between "this dashboard refreshed itself" and "why does this number disagree with my Excel?"
Mini Project
Business problem: The regional managers need one self-serve monthly review they can filter to their region — without emailing you for a new screenshot every week.
Dataset: a 1,000+ row sales export with order date, region, category, product, salesperson, sales amount (or reuse your cleaned data-cleaning export).
Objective: a published, refreshable, filtered-by-region monthly business review.
Task 1
Task 2
Task 3
Task 4
Task 5
Task 6
| Deliverable | Proves |
|---|---|
| Star-schema model | Fact + dimensions + date table |
| Verified DAX measures | Measures correct under any filter |
| Interactive KPI page | One-meeting report design |
| Region drill-through + RLS | Self-serve, secure sharing |
| Published + refresh note | Production-style delivery |
Key Takeaways
- Power BI = Desktop (build) + Service (share & refresh)
- Power Query = your cleaning as replayable steps; set types last
- Model as a star schema: facts in the middle, dimensions around, real Date table
- Relationships flow filters; keep them one-directional and one-to-many
- Measures react to filter context; columns are baked per row — prefer measures
- DIVIDE, CALCULATE, ALL, SAMEPERIODLASTYEAR, TOPN cover most needs
- One visual = one question; page reads top-to-bottom, decision first
- Publish + schedule refresh + RLS turns the report into a product
Key Terms & Glossary
| Term | Meaning |
|---|---|
| star schema | A model with one central fact table of events surrounded by dimension tables you slice by — the foundation of trustworthy Power BI work. |
| fact table | The table holding the measurement events, one row per order line, with numeric facts and the key columns that link to dimensions. |
| dimension table | A descriptive table such as customers, products or the Date calendar that provides the labels you filter and group by. |
| measure | A DAX formula evaluated at query time for whatever slice the report currently shows, so the same measure stays correct at every level of filtering. |
| CALCULATE | The DAX function that rewrites the filter context before evaluating its inner expression — the engine behind percent-of-total and time intelligence. |
| row-level security | RLS: filtering the model per viewer role with DAX rules, so each user sees only their own data in the same shared report. |
Learning Resources
Microsoft Learn — Power BI Learning Path
The official guided route: Power Query, modeling, DAX, visuals and publishing.
Power BI Data Analyst Associate (PL-300)
The industry certification that maps 1:1 to this topic — sit it after you finish.
SQLBI
The definitive DAX resource — articles and videos by the authors of the DAX reference.
DAX Patterns
Copy-ready, tested DAX snippets for percent-of-total, time intelligence, top-N and more.
Guy in a Cube
Huge YouTube library of real-world Power BI tips, model fixes and publishing tricks.
Enterprise DNA
Advanced Power BI tutorials and a free community of report-builders to learn patterns from.
Chapter Quiz
Chapter Quiz — Power BI
From the two halves of Power BI to star models, DAX measures, RLS and report design.
Question 1 of 5
What is the division of labor between Power BI Desktop and Power BI Service?
Knowledge Check
End-of-Topic Exam
Hint: Think grain, duplicated description and DAX filter surprises.
Model answer: A flat table repeats descriptive columns on every row, creates an ambiguous grain, and gives DAX no clean structure to filter, so totals and time intelligence behave unpredictably. A star schema keeps one clean row definition in the fact table and lets filters flow predictably from the dimensions. As a result, measures stay trustworthy under any slice the user applies.
Hint: DATESINPERIOD moves through the calendar.
Model answer: Revenue rolling 12 months = CALCULATE( [Total Revenue], DATESINPERIOD( dates[Date], MAX( dates[Date] ), -12, MONTH ) ). The Date table is non-negotiable because time intelligence moves through a continuous calendar linked to the fact table's date column; without it, 'the last 12 months' has no reliable anchor and the rolling window cannot be computed.
Hint: Think division by zero and blanks.
Model answer: Summing already-divided values is wrong for a ratio, and the row-level division errors when b is zero instead of returning blank. The corrected measure is Revenue per Order = DIVIDE( [Total Revenue], COUNTROWS( orders ) ), which returns blank on division by zero and stays correct at every aggregate level.
Hint: Roles plus a DAX rule, enabled in the service.
Model answer: Set up row-level security: create a small role table mapping usernames to regions, write a DAX filter that links the report user to their region, and assign users to the role. Enable the role in Power BI Service so the single shared report is filtered per viewer at query time, without duplicating the report for each region.