Ravindra BagaleCourses & study guides Track your progress

Guides

Star Schema vs Snowflake Schema in Power BI

A star schema keeps attributes on the dimension: City and State live on Store, one hop from Sales. A snowflake splits those attributes into more tables: Store points at City, City points at State. The sales numbers can match. The model is heavier to filter and to explain.

Friends! The source database arrived as Store, then City, then State. Why not leave that snowflake? Because every extra hop is another relationship for DAX to trust. How? We put City and State back on the FreshBasket Store table, keep one line to Sales, and still get Mumbai 150 and Maharashtra 190. Flatten first. Snowflake later, if a real reason appears.

Quick answer

Vertical path:

  1. Star: Sales in the centre. Store holds Store ID, City, and State.
  2. One relationship. A State slicer filters Store, then Sales.
  3. Snowflake: Store → City → State. Same rupees, two hops.
  4. Maharashtra still totals 190 if both cities sit in that state. Mumbai is still 150.
  5. Learners should flatten City and State onto Store in Power Query.
  6. Keep a snowflake only when a shared table must serve many dimensions and you can test every slicer.
Star:      State column on Store → Sales
Snowflake: State → City → Store → Sales

Same shop, two shapes

Sales (the fact, either shape):

Order Store ID Amount
A S1 100
B S1 50
C S2 40

Star Store (attributes live here):

Store ID City State
S1 Mumbai Maharashtra
S2 Pune Maharashtra

Snowflake pieces:

Store ID City ID
S1 C1
S2 C2
City ID City State ID
C1 Mumbai MH
C2 Pune MH
State ID State
MH Maharashtra

What a reader sees:

  1. Star, City = Mumbai: one hop, rows A+B, 150.
  2. Star, State = Maharashtra: both stores, 190.
  3. Snowflake, State = Maharashtra: State filters City, City filters Store, Store filters Sales. Still 190.
  4. The number did not get better. The path got longer.
  5. A missing City ID blanks the store. Two joins, two places to break.

The star schema guide shows how to build the centre and the dimensions. This page is only the choice between one hop and many.

What do I need before this guide?

Before and after (look at the tables first)

Before flatten Snowflake path from state to store.

Before - Snowflake hops. Same 150, three hops

After star flatten City and state on the store table.

After - Star, one hop. Mumbai 150. Maharashtra 190.

How to flatten a snowflake

Snowflake hops Snowflake hops. State Maharashtra → City Mumbai / Pune → Store S1 / S2 → Sales. Still 190, more lines. Snowflake hops State Maharashtra → City Mumbai / Pune → Store S1 / S2 → Sales. Still 190, more lines.

A snowflake sends State through City and Store before it reaches Sales. Same rupees, more hops.

  1. In Power Query, start from Store (Store ID, City ID).
  2. Merge City onto Store using City ID. Expand City and State ID.
  3. Merge State onto that result using State ID. Expand State name.
  4. Remove the helper ID columns you do not need for the relationship.
  5. Right-click the City and State queries and clear Enable load if nothing else needs them in the model.
  6. Close and Apply. Relate Sales[Store ID] to Store[Store ID] only.
  7. Test Mumbai 150 and Maharashtra 190.
Star, one hop Star, one hop. Store holds City and State. One line to Sales. Mumbai = 150 Maharashtra = 190 Star, one hop Store holds City and State. One line to Sales. Mumbai = 150 Maharashtra = 190

A star keeps City and State on Store. One relationship. Maharashtra is still 190 and Mumbai is still 150.

You did not delete the source files. You stopped the extra tables from becoming extra relationships. Reference versus Duplicate is the Power Query choice when several queries must share that cleaning. The star is the modelling choice.

When a snowflake is not a mistake

  1. A Date table should stay its own dimension. Do not paste a calendar onto every fact. That is not the snowflake we are avoiding.
  2. A Product table used by Sales and by Targets can stay one dimension. That is still a star (two facts, one product).
  3. A true snowflake is a dimension pointing at another dimension for a label you could have kept on the first table.
  4. If the warehouse team owns a snowflake and you must not reshape it, document the hops and test State, City, and Store slicers. Do not pretend it is a star.

Mistakes and calm fixes

Symptom Likely cause Fix
State slicer does nothing The State hop was never related Relate it, or flatten State onto Store
Three relationships for one label Snowflake left as delivered Merge in Power Query
City name edited in two tables Label copied onto fact and dimension One home for the label
“I need snowflake for the interview” Saying the word without a path Draw both shapes and the 150 / 190 test

Ravindra Bagale's Tip

Interview line: “I prefer a star. Snowflake splits dimensions into more hops. I flatten those hops in Power Query unless a shared table truly needs to stay separate.” Got it?

Practice task

  1. Sketch the snowflake on paper: Store, City, State.
  2. Merge City and State onto Store.
  3. Disable load on the helpers.
  4. Prove Mumbai 150 and Maharashtra 190 with one relationship.
  5. Say out loud how many hops the State slicer used before and after.

Learn it properly

Course lesson:

Related: Star schema · Duplicate vs reference

Got it? Star is one hop. Snowflake is extra hops for the same 150 and 190. Flatten while you learn. Next: a composite model, when the sales model is already published and you only need to add a local target. Let us go ahead.

Frequently asked questions

What is a star schema?

One fact in the centre and dimension tables around it, with attributes on those dimensions.

What is a snowflake?

A dimension split into more tables, such as Store, City, and State, each joined onward.

Do the totals change?

Not if the joins are correct. Maharashtra is still 190. The path is just longer.

Should beginners use snowflake?

No. Flatten into a star unless a shared table must stay separate.

Is a Date table a snowflake?

No. A separate Date dimension is normal in a star.

Course lesson?

Star schema vs snowflake, in the data modelling chapter.