The star schema: how to build a data model

A report is only as good as its data model. Almost every good Power BI model has the same shape: one table with the transactions in the middle and the descriptive tables around it. This shape is called a star schema.

In short: the fact table holds the transactions with numbers (orders, bookings, hours), many rows. The dimension tables describe them (product, customer, region, date), few rows, every key once. Relationships connect each dimension to the fact table on its key.

Prerequisites: level 2, most recently Conditional column.

Try it now

This is model view as an exercise: the tables at the top, the relationships below. The matrix recalculates after every change, so you see straight away what a relationship does.

Task The model has four tables but no relationships yet, so the matrix shows the same sales in every row. Connect the fact table Sales to Product and to Region, each on the ID column.

Sales 120 rows, 7 columns
OrderIDOrderDateShipDateProductIDRegionIDQuantityAmount
13 Oct 20266 Oct 20261221798
29 Nov 202519 Nov 20252351145
320 Sep 202627 Sep 2026544596
416 Jun 20252 Jul 20252151145
526 Mar 202631 Mar 20261343596
64 Dec 202510 Dec 2025545745
78 Jul 202526 Jul 2025614196
820 Feb 20251 Mar 202532359.7
99 Dec 202524 Dec 202562298
1012 Aug 202625 Aug 2026212458
117 Sep 202612 Sep 2026542298
122 Mar 202614 Mar 2026623147

Showing the first 12 of 120 rows.

Measures: [Total Sales]

Product 6 rows, 4 columns
ProductIDProductCategoryPrice
1LaptopHardware899
2MonitorHardware229
3MouseAccessories19.9
4KeyboardAccessories39.9
5Office suiteSoftware149
6AntivirusSoftware49
Region 4 rows, 2 columns
RegionIDRegion
1North
2South
3West
4East
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

Showing the first 12 of 730 rows.

Facts and dimensions

Fact tableDimension table
Contenttransactions: orders, bookings, shipmentsdescriptions: products, customers, regions, days
Rowsmany, growing all the timefew, rarely changing
Columnskeys and numbers (quantity, amount)keys and text (name, category)
In the reportvalues in measuresrows, axes, slicers

Every dimension has a key that appears only once in it, such as ProductID. The fact table holds the same key on every order of that product. That is how the relationship connects both tables.

Why not one big table?

In Excel, everything often ends up in one wide list: order, product name, category, price, region, all in every row. That works but has drawbacks: product data is repeated thousands of times, a change of category has to happen everywhere, and the file gets big. In a star schema every piece of information exists exactly once. Power BI is built for this: filters on dimensions flow through the relationships into the fact table, measures stay simple and the model stays fast.

One more exercise: the wrong relationship

A relationship can work technically and still be wrong. The matrix gives it away.

Task The matrix only shows sales per region for a few orders, while total sales are much higher. One relationship connects the wrong columns. Delete it and connect Region on the right column.

Sales 120 rows, 7 columns
OrderIDOrderDateShipDateProductIDRegionIDQuantityAmount
13 Oct 20266 Oct 20261221798
29 Nov 202519 Nov 20252351145
320 Sep 202627 Sep 2026544596
416 Jun 20252 Jul 20252151145
526 Mar 202631 Mar 20261343596
64 Dec 202510 Dec 2025545745
78 Jul 202526 Jul 2025614196
820 Feb 20251 Mar 202532359.7
99 Dec 202524 Dec 202562298
1012 Aug 202625 Aug 2026212458
117 Sep 202612 Sep 2026542298
122 Mar 202614 Mar 2026623147

Showing the first 12 of 120 rows.

Measures: [Total Sales]

Product 6 rows, 4 columns
ProductIDProductCategoryPrice
1LaptopHardware899
2MonitorHardware229
3MouseAccessories19.9
4KeyboardAccessories39.9
5Office suiteSoftware149
6AntivirusSoftware49
Region 4 rows, 2 columns
RegionIDRegion
1North
2South
3West
4East
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

Showing the first 12 of 730 rows.

This exercise is part of Premium.

Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.

See Premium Already Premium? Log in

The first exercise in this lesson is free.

In real Power BI

  1. Model view: the third icon on the left. Each table appears as a box with its columns.
  2. Draw a relationship: drag a key column onto the matching column of the other table, or Home, Manage relationships, New relationship.
  3. Arrange: the fact table in the middle, the dimensions around it. That way you see the star and spot quickly where something is missing.
  4. Autodetect: Power BI often creates relationships by itself when loading if columns have the same name. Always check them, as the second exercise shows.

Common mistakes

Same value, different meaning

Order number 3 and RegionID 3 are both numbers but have nothing to do with each other. Power BI only checks whether the values match.

A (Blank) row in the matrix

If an order finds no matching key in the dimension, Power BI collects it under (Blank). That almost always signals a wrong relationship or missing master data.

Chaining dimensions

If Category hangs off Product and Product off the fact table, you get a snowflake. It works but is slower and harder to follow. Better: bring the category into the product table as a column, for example with Merge Queries.

Frequently asked questions

Can a model have several fact tables?

Yes, for example Sales and Budget. Both hang off the same dimensions such as Date and Region, so they can be compared in one matrix.

Where does the name come from?

Draw the fact table in the middle and the dimensions around it, and the picture looks like a star.

Learn this next: relationships

Create relationships, active and inactive, several date columns.

Relationships

Write to us

Choose language

Select your preferred language