Stop 06 · Data ModelingTopics · 2/9

Star Schema in Power BI

Part of the Power BI Roadmap

In short

Microsoft's own guidance says it plainly: build a star schema. DAX, slicers and totals behave most predictably when one fact table sits in the middle with dimensions around it.

A star schema has one fact table in the centre with one-to-many relationships to dimension tables. Microsoft recommends it for Power BI because DAX and filtering work most predictably on it.

The jaadu stands on a big central railway platform as toy trains arrive from tracks spreading out in every direction like the points of a star.

Think of it like this

A railway junction

Nagpur junction sits in the middle and lines go out to Mumbai, Delhi, Chennai and Kolkata. Every trip passes through the centre. In a star schema, the fact table is the junction and each dimension is a line. Filters travel from the outer stations into the centre.

Watch it happen

A retail star

Sales (fact)
Date
Product
Store
Customer

1/4Sales holds one row per bill line with keys and amounts.

The big ideas

What you need to know

Fact in the centre

Dimensions point at the fact with one-to-many relationships. Dimensions don't link to each other.

Always add a Date table

A proper Date dimension with one row per day is needed for time intelligence. Mark it as a date table.

Filters flow one way

From dimension to fact, single direction. It keeps results predictable.

Smaller and faster

Repeated text lives once in the dimension, so the model compresses better and visuals respond quicker.

See it in code

Walk through the code

dax
1Date =2ADDCOLUMNS (3    CALENDAR ( DATE ( 2024, 4, 1 ), DATE ( 2027, 3, 31 ) ),4    "Year", YEAR ( [Date] ),5    "Month No", MONTH ( [Date] ),6    "Month", FORMAT ( [Date], "MMM" ),7    "FY", IF ( MONTH ( [Date] ) >= 4, YEAR ( [Date] ), YEAR ( [Date] ) - 1 )8)

1/3CALENDAR returns one row per day between the two dates, in a column called Date.

A calculated Date table covering three Indian financial years (April to March). Relate Date[Date] to Sales[OrderDate] and mark it as a date table.

Save yourself the pain

Common mistakes

Oops

Linking dimensions to each other, like Store to Customer, to build a web of tables.

Do this instead

Connect each dimension directly to the fact. Filters then have one clear path.

Oops

Using the auto date/time hierarchy instead of a Date table.

Do this instead

Build one Date dimension and turn off Auto date/time in Options. It's smaller and supports time intelligence properly.

Your mission

Draw your star

~25 min

Quick check

In a star schema, which tables connect directly to each other?

Go deeper

  1. 1Read Microsoft's guidance page on star schema for Power BI.
  2. 2Rebuild a flat Excel export into a star schema.
  3. 3Lay out Model view with the fact table in the middle.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge