Building Your Data Model: Star vs Snowflake

You understand the difference between star and snowflake schemas and can set up a reliable data model.

You can connect tables with the right relationships and set up a STAR schema.

You've fetched and cleaned your data neatly in Power Query. Everything looks ready for building visuals. But as soon as you use filters or combine several tables, the numbers suddenly stop adding up. Sound familiar?

That's almost always down to a mistake in the data model. And that's what we're going to talk about now.

Power BI works differently from Excel. In Excel you can cram everything into one big table. In Power BI you build a model with facts and dimensions, which you connect through relationships. If you get those relationships wrong, your analysis falls apart, even though the dashboard looks fine.

"Power BI lets you do it… until you publish and someone filters on year. Then you suddenly see double revenue."

Fact tables and dimension tables

First the difference:

  • Fact table = transactions, events, measurable things. For example: sales lines, invoices, journal lines.
  • Dimension table = descriptive information. For example: customers, products, calendar, employees.
Rule of thumb for a quick decision

Can you count it, sum it or calculate with it? Fact. Does it describe what, who, where or when? Dimension. Not sure? Then it's usually a dimension, facts are almost always transactional.

A star schema is a simple data model structure in which one central fact table is surrounded by several dimension tables. The fact table holds quantitative data (such as sales, costs or quantities), while the dimension tables provide context for that data (such as time, product or customer).

Star schema: a central fact table surrounded by dimension tables, connected with one-to-many relationships. Source: Microsoft Learn
Star schema: a central fact table surrounded by dimension tables, connected with one-to-many relationships. Source: Microsoft Learn

Characteristics of the star schema

  • Simple structure: easy to understand and to implement.
  • Direct relationships: the fact table has a direct relationship with every dimension table, which leads to faster query performance.
  • Best performance: because the model is so simple, fewer relationships are needed while running queries.

Example of a star schema

You're working with sales data. You have a fact table called Verkoop that holds information such as Verkoopbedrag, Aantal and KlantID. You also have dimension tables such as Klanten, Producten and Tijd. Each dimension table gives extra context to the sales data.

Your model always starts at the fact table. You connect it to the dimensions through unique keys. That gives you a Star Schema: one central table, with rays out to the edge. Star Schema = stable, fast and reliable.

Normalisation and denormalisation, what it is and why you need to understand it

Normalisation means splitting your data into logical tables. Each table has one subject and as little repetition as possible.

  • Customers in a customer table
  • Products in a product table
  • Transactions in a fact table with keys

You see this in almost every source system. Because it:

  • Produces fewer errors
  • Is easy to maintain
  • Works efficiently for databases
Normalised: the sales table stores only the ProductKey and none of the individual product attributes. No repetition. Source: Microsoft Learn
Normalised: the sales table stores only the ProductKey and none of the individual product attributes. No repetition. Source: Microsoft Learn

Keep reading

Leave your name and email address and you can read the rest

You get the whole lesson right away, and every other lesson stays open after that. No password, no confirmation email.

Your address stays with us. No selling to third parties, and you unsubscribe in one click.