Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Data Modeling  ›  Lesson

Star vs Snowflake Schema

Star vs Snowflake Schema 12 minA star schema joins every flattened dimension directly to the fact, while a snowflake chains dimensions to other dimensions, and Power BI generally works best with a star.

Star vs Snowflake Schema

The till database stores products the tidy way a database likes: Products has a CategoryID that points to a Categories table, which has a DepartmentID that points to a Departments table. Arjun loads all three exactly as they are. The field list fills with near-empty tables, and a filter on Department has to travel through three relationships before it reaches Sales. There is a better shape for Power BI.

The rule

Star: every dimension one hop from the fact. Snowflake: dimensions chained to dimensions.

  • In a star schema, the fact table sits in the middle and every dimension joins straight to it. Dimensions are flattened: Products holds Product, Category and Department as ordinary columns.
  • In a snowflake schema, a dimension is split into a chain of smaller tables — Products → Categories → Departments — the way source databases often store them to avoid repeating text.
Star:       Stores ─── Sales ─── Products (Product, Category, Department)
                         │
                        Date

Snowflake:  Stores ─── Sales ─── Products ─── Categories ─── Departments
                         │
                        Date

Power BI works best with a star:

  • fewer relationships to maintain, and fewer tables in the field list for report builders;
  • filters travel one hop instead of several, so the model is simpler to reason about and usually faster;
  • the repeated category text in a flattened Products table costs little, because the model's column store compresses repeated values very well.

To flatten a snowflake, work in Power Query. Merge Categories into Products on CategoryID and expand the category name; then merge Departments on DepartmentID and expand the department name. Finally, right-click the Categories and Departments queries and untick Enable load. They still feed the merge, but they no longer appear as tables in the model.

The shortcut

Count the hops from a dimension column to the fact. More than one hop → flatten it into the dimension that touches the fact.

Flattening ProductsStep 1 of 4
  1. Count the hops

    A filter on Departments crosses Departments → Categories, Categories → Products and Products → Sales: three relationships. Category needs two.

The trap is copying the source's shape because "that's how the database does it". A database is designed to store and update data; a Power BI model is designed to filter and total it. The two jobs favour different shapes.

Drills

Answer fast — trust the rule.

quick drill

Products links to Categories, which links to Departments, and Products links to Sales. What is this shape?

quick drill

Which shape does Power BI generally work best with?

quick drill

In the snowflake, how many relationships does a filter on the Departments table cross to reach Sales?

quick drill

After flattening, how many relationships does a filter on the Department column of Products cross to reach Sales?

quick drill

After merging Categories into Products, why untick Enable load on the Categories query?

Remember

  • Star: every dimension one hop from the fact. Snowflake: dimensions chained to dimensions.
  • Count the hops; more than one means flatten with a merge in Power Query.
  • Trap: copying the source database's shape into the model.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainFlattening a snowflake

Explain the difference between a star and a snowflake schema using Leaf & Cup's Products, Categories and Departments tables, and describe how you would turn the snowflake into a star in Power Query.