Star schema: facts and dimensions

The shape every good Power BI model takes, and why one giant table is a trap.

Module 3: The data model · Lesson 8 of 24 · 14 min read · Free

You could merge everything into one enormous table — every product name, customer name and branch city repeated on every sales line. It works for a while. Then the file gets slow, totals go wrong and every new question needs another merge. Professionals use a star schema instead:

A star schema
  • A fact table in the middle records events: sales lines, payments, loan repayments, attendance. It's long (thousands to millions of rows) and mostly IDs, dates and numbers. Ours is Sales (6,426 rows).
  • Dimension tables around it describe those events: who (Customers), what (Products), where (Branches), when (Date). They're short and full of text you filter and group by.

Each dimension connects to the fact table by a key: Products[Product ID] → Sales[Product ID].

Why it's worth it

  • Filters flow naturally. Click Electronics in a slicer on Products, and Sales filters to electronics lines. Every measure follows.
  • Each fact is stored once. A product's category lives in one row of Products, not on 400 sales lines.
  • DAX stays simple. Most measures are “sum this column of the fact table” — the model handles the rest.
  • It scales. Add a Targets fact table, a Payments fact table, a Staff dimension — each plugs into the same dimensions.

How to tell them apart

Ask: does each row describe a thing, or record something that happened?

TableRowsType
Salesa product sold on an orderfact
Targetsa branch's target for a monthfact
Paymentsa payment receivedfact
Productsa productdimension
Branchesa branchdimension
Customersa customerdimension
Datea calendar daydimension

Check yourself

Answer in your head first, then open each question to see the answer and why.

  1. What does a fact table contain?

    • A Events or transactions, such as sales lines
    • B Descriptions of products
    • C Report pages
    • D Colours and themes
    Show the answer

    A) Events or transactions, such as sales lines — Facts record what happened; dimensions describe it.

  2. Which of these is a dimension table?

    • A Products
    • B Sales
    • C Payments
    • D Targets
    Show the answer

    A) Products — Each row describes a product.

  3. Why avoid merging everything into one giant table?

    • A It's slower, repeats data and makes totals and new questions harder
    • B Power BI can't load big tables
    • C It's not allowed
    • D It uses too many colours
    Show the answer

    A) It's slower, repeats data and makes totals and new questions harder — A star schema stores each fact once and keeps DAX simple.

More free lessons: What Power BI is, and why employers want it · Install Power BI Desktop and find your way around · Getting data: Excel, CSV, folders and more · Measures: the right way to calculate · Choosing the right visual · Design principles for dashboards people use · The Power BI Service and licences