---
title: "Star schema in Power BI: fact and dimension tables"
url: "https://www.datafuji.com/en/star-schema"
lang: en
updated: 2026-11-28
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://www.datafuji.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

- [Home](https://www.datafuji.com/en)

- Star schema

# Star schema in Power BI: facts, dimensions and a worked example

Published November 28, 2026 · Updated November 28, 2026 · 13 min read

[Dylan Arnaud](https://www.datafuji.com/en/about#dylan-arnaud), founder of Datafuji

A star schema organizes data into fact tables (the numbers you add up) and dimension tables (what you slice them by).

It is the structure Microsoft recommends for [Power BI](https://www.datafuji.com/en/what-is-power-bi) : without it, a €20,000 budget can show up as €80,000, with no error message at all. This article demonstrates it with a worked SME example, then provides a troubleshooting table for fixing wrong totals.

## What is a star schema?

A star schema is a data model in which each table has a single role: fact tables measure, dimensions describe. A one-to-many relationship (one customer, many sales) links each dimension to the facts.

The model comes from data warehousing; Ralph Kimball and Margy Ross popularized it in The Data Warehouse Toolkit, which Microsoft cites as a reference. It is a natural fit for the semantic model, the current name for a Power BI data model: every visual sends it a query that filters, groups, then sums. Dimensions filter and group; facts are summed.

| Element | What it contains | Example in a distribution SME |
| --- | --- | --- |
| Fact table | One row per measured event: keys and numbers | Sales: one row per invoice line |
| Dimension table | One row per thing described: a unique key and columns to filter by | Customers: one row per customer, with its region |
| Relationship | One-to-many, with the filter flowing from the dimension to the facts | Customers filters Sales, never the other way around |

No checkbox declares a table a “fact table”: the relationship decides. In a star, the “one” side is a dimension and the “many” side a fact table. The snowflake (a dimension split into several chained tables) and the bridge table (a small table that links two dimensions) are the exceptions. Marco Russo and Alberto Ferrari, leading authorities on DAX (Power BI’s formula language), draw a rule from this: the model is part of the calculation.

### What is the difference between a fact table and a dimension table?

A fact table records events and the numbers you add up, one row per sale or per invoice. A dimension table describes what you slice them by: the customer, the product, the date.

The business question settles it. In “revenue by region and by month,” revenue is summed, so it is a fact; region and month slice it, so they are dimensions.

A fact table keeps one row per event, and that “one row per…” is called the grain, or granularity in Microsoft’s documentation. A sales targets table related to dates and products, in which every date is the first of the month, has a month-product grain: that is Microsoft’s example.

Kimball distinguishes three kinds of facts, and the distinction explains many wrong totals:

| Kind of fact | Examples | What you are allowed to add up |
| --- | --- | --- |
| Additive | Amount excl. VAT, quantity, hours | Everything: by customer, by product, over time |
| Semi-additive | Inventory, bank balance, headcount | Across warehouses or accounts, never from one month to the next: take the last balance |
| Non-additive | Markup or margin percentage, unit price, any percentage | Nothing: add up the numerator and the denominator, then divide |

The list price describes the product: it goes in the Products dimension. The price paid changes with every sale: it is a fact. Microsoft allows one exception: an order or invoice number can stay in the fact table to serve as a filter; this is called a degenerate dimension.

## Why does a flat table give wrong totals?

A flat table mixes two grains: sales live at invoice-line level, the budget at month and product-category level. Copied onto every sales row, the budget is added up as many times as there are sales.

It all starts with an export, one big table in which every row carries the sale, the customer, the product and the date. It works for two weeks, then a total doubles for no apparent reason.

The SME in our example is a fictional distributor. In March, its Tools category has a budget of €20,000 excl. VAT, which someone added to the sales export to compare the two:

| Date | Customer | Product | Amount excl. VAT | Category budget |
| --- | --- | --- | --- | --- |
| Mar 3 | Dupont Construction | Drill D-18 | €6,200 | €20,000 |
| Mar 11 | Dupont Construction | Discs G-125 | €1,300 | €20,000 |
| Mar 19 | Martin Renovation | Drill D-18 | €8,000 | €20,000 |
| Mar 27 | Dupont Construction | Screwdriver S-12 | €3,100 | €20,000 |
| Total shown | 4 customers | — | €18,600 | €80,000 |

The total row contains two errors, and each one leads to another:

- The budget shows €80,000 instead of €20,000. Budget attainment drops to 23% instead of 93%, and the leadership team believes Tools is in crisis.

- The number of customers is 4 instead of 2, because rows are being counted. Average revenue per customer drops to €4,650 instead of €9,300.

Only revenue, €18,600, is right. That is the trap: the first number you check is correct, so you trust the others.

At the management meeting, the FP&A analyst (contrôleur de gestion in France) presents that 23%, and the sales director swears the sales teams are above 90%: it is the report that is wrong.

![A budget row of €20,000 for Tools in March, copied onto the four sales rows of the month. The sum shows €80,000 and 23% of budget achieved, instead of €20,000 and 93%.](https://www.datafuji.com/img/en/articles-schema-en-etoile-power-bi/articles-schema-en-etoile-power-bi-01.svg)

*Entered once, read four times: the Tools budget goes from €20,000 to €80,000.*

Nothing was entered incorrectly: it is the shape of the table that multiplies the budget. Russo and Ferrari speak of an “over-denormalized” table: information stored at the wrong grain makes totals non-additive. A clever formula can fix a total once it is spotted; the lasting cure lies in the model.

## What does an SME’s star schema look like?

One Sales fact table and four dimensions are enough for a distribution SME: Dates, Customers, Products and Sales Reps. With them, it tracks revenue and margin by month, customer, product category and sales rep.

Here is the complete model, as it appears in Power BI’s model view.

![The SME’s star schema. In the center, the Sales fact table, one row per invoice line, with four keys, the quantity, the amount excluding VAT and the purchase cost. Around it, four dimensions in one-to-many relationships: Dates, one row per day; Customers; Products, with the category and the list price; Sales Reps, with the branch. Each relationship filters from the dimension to the facts.](https://www.datafuji.com/img/en/articles-schema-en-etoile-power-bi/articles-schema-en-etoile-power-bi-02.svg)

*A narrow fact table in the center, four dimensions around it: every filter follows a single relationship.*

This diagram reads like a contract:

- The Sales table describes nothing: keys and amounts, no customer name or category. It grows every day but stays narrow.

- Each dimension has a unique key: a customer appears once in Customers, and the count is right again: 2, not 4.

- A single calendar, with your fiscal years and workdays, filters every fact table.

- Filters flow downhill: “West branch” in Sales Reps filters Sales, never the other way around.

Measures, the calculation formulas that Power BI re-evaluates according to the filters, become short and correct at every level. Let’s give our four sales their purchase cost: €4,340, €780, €5,600 and €2,170, or €12,890 in total.

Markup = (amounts excl. VAT − purchase costs) ÷ purchase costs = (18,600 − 12,890) ÷ 12,890 = 44.3%

Calculated on cost, this ratio is a markup; gross margin would be calculated on revenue. The average of the four line markups (42.9%, 66.7%, 42.9%, 42.9%) would give 48.8%: the small sale of discs would weigh as much as the large sale of drills. So the model stores amounts and costs, never ratios ([the average of averages, in detail](https://www.datafuji.com/en/kpi#calculation)).

The reasoning holds beyond sales. In maintenance, for example, planned work and actual work may not be recorded at the same grain: the grain question then comes up on the very first page.

## How do you turn a flat table into a star schema?

You go from a flat table to a star schema in two stages: four decisions made with the business, then the split in Power Query, the data preparation tool built into Power BI. The decisions come before you open Power BI, the split comes before the model: no patch-up formulas afterward.

The four decisions are Kimball’s, in this order. Applied to our SME:

- The business process: invoicing. One process, one fact table.

- The grain: “one row = one invoice line.” If you cannot write that sentence, you cannot build the model. Choose the finest grain: you can always roll up, but you can never drill into detail that does not exist.

- The dimensions: everything that is true at that grain (the day, the customer, the product, the sales rep).

- The facts: the quantity, the amount excl. VAT, the purchase cost. The monthly budget, at a different grain, goes into another fact table.

In [Power Query](https://www.datafuji.com/en/power-query), each dimension is created as a reference to the original query. You keep the key and the descriptive columns, remove duplicates, and add an index column if the source has no reliable key. The fact table loses its descriptions and keeps keys and amounts.

Then come the relationships, one-to-many and single-direction, and finally hiding the keys: the model is ready when the reader sees the business, not the plumbing.

## Which data modeling pitfalls skew totals?

Four mistakes show up in almost every shaky model: the many-to-many relationship, the fact stored in a dimension, the missing date table and the date with several roles. None of them triggers an error message.

### Pitfall 1: the many-to-many relationship

Power BI will let you relate two columns that each contain duplicates. It is almost always the sign of a poorly defined grain or a missing dimension; the only common exception is a budget related at the month level (see actual vs budget). Russo and Ferrari show the effect: totals that no longer equal the sum of their rows.

The rule: two fact tables are never related to each other; they are compared through their shared dimensions. For a genuine link between two dimensions, a sales rep assigned to several regions for instance, Microsoft recommends a two-column bridge table holding the sales rep key and the region key.

### Pitfall 2: fact columns in dimensions

A “Total revenue” column in the Customers table is calculated at refresh, then frozen: your choice of period does not change it, and it ends up contradicting the official measure. A dimension describes; it does not count. Anything you add up belongs in a measure:

Revenue = SUM ( Sales[Amount] )

In a table visual by customer, the measure follows the period filter; the column does not. Russo and Ferrari tell developers as much: prefer measures, and keep a column only if it serves as a filter or an axis.

### Pitfall 3: no dedicated date table

By default, Power BI creates a hidden date table for every date column. The consequence, noted by Microsoft: a time filter applied to one table does not propagate to the others, and comparing sales with the budget becomes painful.

A dedicated date table solves three problems:

- A single calendar filters every fact table, sales and budget included.

- It carries your rules: a non-calendar fiscal year, weeks, workdays. Auto date/time only knows the calendar year.

- Time comparisons require it: year-to-date and same period last year need one day per row, with no gaps, over the relevant years only.

Turn off auto date/time (the option that creates those hidden tables), build your calendar, mark it as a date table and relate it to every fact table. For a monthly budget, Ferrari and Russo show that calculations at the month level are the simplest, as long as no one drills below the month.

### Pitfall 4: one date, several roles

A sale often has several dates: order, delivery, invoice. The same Dates table can filter by each of them, but only one relationship between two tables can be active, that is, used by default for filtering. Microsoft calls this a role-playing dimension.

In our SME, the screwdriver ordered on March 27 is delivered on April 3; the other three sales are delivered in March. Depending on which date is used to filter, March revenue is €18,600 or €15,500, and attainment 93% or 77.5%. There are two ways to set it up.

![Two setups for a sale ordered on March 27 and delivered on April 3. On the left, a single Dates table with an active relationship on the order date and an inactive one on the delivery date, used by a measure with USERELATIONSHIP. On the right, two tables, Order Dates and Delivery Dates, each with its own active relationship. March revenue is €18,600 and 93% of budget by order date, €15,500 and 77.5% by delivery date.](https://www.datafuji.com/img/en/articles-schema-en-etoile-power-bi/articles-schema-en-etoile-power-bi-03.svg)

*One date, two readings: €18,600 of revenue in March by order date, €15,500 by delivery date.*

On the left, the inactive relationship is only used in measures that call it with USERELATIONSHIP, a DAX function that activates the relationship for the duration of a calculation: one measure per role. On the right, one table per role allows both filters at once, at the cost of a duplicated calendar. Either way, name the role in every title.

## Star, snowflake or galaxy schema: which should you choose?

For Power BI, the target is the star, one table per dimension. The snowflake splits a dimension into chained tables, which you flatten. The galaxy schema (or fact constellation), in which several fact tables share the dimensions, becomes the norm as soon as a budget comes in.

| Schema | Shape | For Power BI |
| --- | --- | --- |
| Flat table | Everything in a single table | Acceptable for a single grain, one source and few readers; avoid it as soon as a budget comes in |
| Star | One fact table, one table per dimension | The target, recommended by Microsoft for performance and usability |
| Snowflake | A dimension split into a chain: Products, Subcategories, Categories | Generally flatten it into a single Products table |
| Galaxy (fact constellation) | Several fact tables that share dimensions | Standard as soon as you compare actuals with budget |

Microsoft gives the reasons to flatten the snowflake: more tables to load, longer filter chains, a more cluttered Data pane, and no hierarchy possible across columns from different tables.

![On the left, a snowflake: the Sales fact table related to Products, itself related to Subcategories, then to Categories, three filter hops. On the right, the star: a single Products table with the Description, Subcategory and Category columns, and a Category, Subcategory, Product hierarchy, one hop from Sales.](https://www.datafuji.com/img/en/articles-schema-en-etoile-power-bi/articles-schema-en-etoile-power-bi-04.svg)

*Three chained tables become a single Products dimension, with its hierarchy, one hop from sales.*

The trade-off is slight redundancy: the category name repeats on every product, which stays negligible in a dimension of a few thousand rows.

### The FP&A analyst’s case: actual vs budget

The budget from our opening example lives at the month-and-category level, sales at the day-and-SKU level: two grains, so two fact tables. They are compared through Dates, by month, and through Products, by category.

![The SME’s galaxy schema: the Sales fact table, at invoice-line grain, and the Budget fact table, at category-and-month grain, share the Dates and Products dimensions. Budget is related to Dates by month and to Products by category, many-to-many with a single filter direction. No direct relationship between Sales and Budget. For Tools in March 2026: €18,600 actual, €20,000 budget, 93% attainment. Below the category, the budget repeats and must be allocated by a written rule.](https://www.datafuji.com/img/en/articles-schema-en-etoile-power-bi/articles-schema-en-etoile-power-bi-05.svg)

*Sales and Budget each keep their own grain: Tools in March finally shows €18,600 against €20,000, or 93%.*

Each amount is summed at its own grain, hence the correct rate. Dimensions shared by several fact tables are what Kimball calls conformed dimensions.

Ferrari and Russo describe this setup in their budget pattern. The budget is related to the dimensions at its own level, month and category, through a many-to-many relationship with a single filter direction. Below that level, it is repeated, not allocated. The Month column must include the year, in the form “2026-03”; otherwise March 2025 and March 2026 get mixed up.

Below the category, each drill would therefore show the full €20,000 Tools budget. For a budget by product, you need a written allocation rule, for example in proportion to last year’s sales: a management decision, not a technical setting.

## When is a star schema not necessary?

When there is only one source, one grain and one reader, or a one-off question. Conversely, a star schema in Power BI is no longer enough when volumes explode or when the history of changes must be kept.

- One source, one grain, one reader: a monthly export analyzed in a [pivot table](https://www.datafuji.com/en/pivot-table) does not need a model.

- A one-off analysis: Excel is faster ([Power BI or Excel](https://www.datafuji.com/en/power-bi-vs-excel)).

- A report your accounting software or CRM already provides: check it first.

At the other extreme, take a sales rep who moves from the West branch to the East branch on July 1. For the rep’s past sales to stay with the West branch, the dimension must keep two dated versions of the rep: this is a type 2 slowly changing dimension (SCD 2).

Power Query cannot produce these versions: it reloads the latest value and rewrites history. In that case, as for very large volumes, Microsoft recommends a [data warehouse](https://www.datafuji.com/en/data-warehouse) upstream, which Power BI reads from.

## Why is a total wrong in Power BI? Symptom, cause, fix

When a total is wrong in Power BI, the cause is almost always in the model, and so is the fix. Nine symptoms, as seen from the report, each point to a specific cause and its remedy.

| What you see | The cause in the model | The fix |
| --- | --- | --- |
| The budget grows when you drill down to product, customer or day | Budget copied onto every sale, or related at a finer grain than its own | A Budget fact table at its own grain, compared through shared dimensions |
| More customers than in your customer file | Sales rows are being counted | A Customers dimension and a distinct count measure |
| The same number repeats on every row | The filter does not reach the facts: no relationship, or the wrong direction | Relate the dimension to the facts, from the one side to the many side |
| A total does not equal the sum of its rows | Many-to-many relationship or bidirectional filter | One-to-many, single-direction relationships; a bridge table if needed |
| A “(Blank)” row appears | Some sales carry a code missing from the dimension | Complete the dimension or fix the source; do not hide the row, its amount is real |
| Last year or year-to-date is wrong, or blank | No complete date table marked as such | A Dates table related to every fact table |
| A customer’s “Total revenue” does not change with the period | A fact stored in a dimension | Replace it with a measure |
| Inventory adds up from one month to the next | A balance is semi-additive | A measure that takes the last balance |
| The total markup is the average of the rows | A ratio is not additive | Divide total gross profit by total purchase cost (by total revenue for gross margin) |

Start from the symptom your management saw: the fix is already spelled out.

The [Power BI data model](https://www.datafuji.com/en/power-bi-data-model) guide details the signs of a shaky model as seen by management. The [Power BI dashboard](https://www.datafuji.com/en/power-bi-dashboard) guide shows complete reports built on this model. The [financial dashboard](https://www.datafuji.com/en/financial-dashboard) guide gives the formula and the source for each of its twelve KPIs.

### Where to start with your own model

Ask each table the grain question: if the answer does not fit in one sentence, you know what is left to do. Then look for the columns that repeat (customers, products, dates): those are your first dimensions. Finally, run the three numbers your management looks at first through the troubleshooting table.

For the March management meeting, the fix comes down to a Budget table at its own grain and two relationships. The following month, the FP&A analyst and the sales director read the same 93%, and the meeting can finally talk about the missing €1,400.

## Frequently asked questions

### What is dimensional modeling?

It is the design method, formalized by Ralph Kimball, that organizes analytical data into facts and dimensions. The star schema is its most common form; the snowflake and the galaxy schema are variants. It starts from a business process and its grain, not from the structure of the source software.

### What is a surrogate key?

A unique identifier, absent from the source, that is added to a dimension table. It becomes necessary when the source has no reliable key, or when the same customer must exist in several versions. In Power BI Desktop, a Power Query index column plays this role.

### Can you build a star schema in Excel?

Yes. Excel’s Data Model (Power Pivot) can hold several related tables, and Power Query, built into Excel, lets you split a flat table. PivotTables built on this model follow the same rules as Power BI.

Sources

- Page dates are the “Last updated” dates shown on the English edition of each Microsoft page linked below, checked on November 28, 2026.

- Microsoft Learn, [Understand star schema and the importance for Power BI](https://learn.microsoft.com/en-us/power-bi/guidance/star-schema), page dated December 30, 2024 (fact and dimension tables, granularity, surrogate keys, snowflake, slowly changing, role-playing and degenerate dimensions, bridge table), accessed November 3, 2026, rechecked November 20, 2026.

- Microsoft Learn, [Auto date/time guidance in Power BI Desktop](https://learn.microsoft.com/en-us/power-bi/guidance/auto-date-time), page dated December 12, 2025 (one hidden table per date column, filters that do not propagate between fact tables, calendar periods only), accessed November 20, 2026.

- Kimball Group, [Four-Step Dimensional Design Process](https://www.kimballgroup.com/data-warehouse-business-intelligence-resources/kimball-techniques/dimensional-modeling-techniques/four-4-step-design-process/), accessed November 20, 2026.

- Ralph Kimball and Margy Ross, The Data Warehouse Toolkit: The Definitive Guide to Dimensional Modeling, 3rd edition, Wiley, 2013 (additive, semi-additive and non-additive facts; four-step design process; conformed dimensions).

- Marco Russo and Alberto Ferrari, The Definitive Guide to DAX, 3rd edition, Microsoft Press: chapter 1 (relationships and filter direction), chapter 2 (measures and calculated columns), chapter 5 (over-denormalized table, non-additive measures), chapter 6 (blank row from an invalid relationship), chapter 9 (many-to-many relationships, bridge tables, non-additive totals), chapter 13 (complete date table, with no gaps, limited to the relevant years).

- Alberto Ferrari and Marco Russo, DAX Patterns, 2nd edition, SQLBI: chapters 1 and 3 (month-level calculations), chapter 7 (semi-additive balances), chapter 14 (distinct count), chapter 24 (budget related at its own grain, allocation in proportion to the previous year).
