01.5Fact table and dimension tables

A flat table is handy to get started. In the long run, it isn’t recommended. Here is why, and what Microsoft recommends instead.

01.5.1Behind your extract, several tables

If your data comes from an extract, keep in mind that the software doesn’t store it in a single table. It keeps the sales on one side, the customers on another and the products on yet another. To produce your flat table, it made all these tables work together.

Splitting tables is therefore not an idea specific to Power BI. It is how databases are organized, for a good reason, space and speed.

01.5.2What repetition costs

In a flat table, the name, the city and the brand are copied onto every sale. These repetitions make the file heavier. With millions of rows, Power BI takes longer to calculate, and the visuals respond more slowly.

And it is the person viewing the report who waits. A fast report is a report people want to use.

Repetitions also set calculation traps. How many customers does the dealership have?

Counting the rows gives the number of sales, not the number of customers. And a customer who hasn’t bought anything yet has no row, so they appear nowhere.

01.5.3What Microsoft recommends

For a Power BI model, Microsoft recommends splitting the data into two kinds of tables, fact tables and descriptive tables, called dimension tables.

The split loses nothing. Each sale keeps the code of its customer and of its product.

01.5.4The fact table tells what happened

The Sales table tells what happened, one row per sale. It is the fact table.

It holds the numbers you want to add up, like the quantity and the amount. It grows every day, since each new sale adds a row. In a real company, it often has millions of rows.

Table Sales
Sale IDDateCustomer IDProduct CodeQtyAmount
V0011/15/2024C001A10110250,000
V0023/8/2024C002A2023150,000
V0035/20/2024C004A2014100,000
V0049/12/2024C005A10210100,000
V00511/25/2024C006A2016150,000
V0061/10/2025C001A1018200,000
V0072/18/2025C003A2023150,000
V0083/27/2025C002A10215150,000
V0095/6/2025C004A2016150,000
V0107/14/2025C005A2023150,000
V0119/30/2025C007A2022100,000
V01212/2/2025C006A102550,000
Table: Sales (12 rows)

This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.

Notice the Customer ID and Product Code columns. Sales doesn’t say who the customer is or what the product is. It only gives their code.

01.5.5Dimension tables describe

The Customers and Products tables describe what the sales are about, who buys and what is sold. They are dimension tables.

They have few rows, one per customer or per product, and rarely change. Their columns are used to group and filter, like a customer’s city or a product’s brand.

Tip

The Calendar date table, seen just before, is a dimension table too. It describes the dates, one row per day.

A question like “revenue by city” brings the two together. The revenue comes from the fact table. The city comes from the Customers dimension table.

01.5.6The advantages over the flat table

Splitting sales, customers and products brings several advantages.

  • A lighter file. The fact table, the longest one, keeps only one code per customer and per product. The name, the city and the brand are written once, in their dimension.
  • Identical descriptions everywhere. A customer’s name is written on a single row. In a flat table, one sale entered as “Pari” instead of “New York” adds an extra city to the visuals.
  • A fix in one place. If a customer changes name, you correct one row of Customers, and all their sales follow.
  • Complete lists. The Customers table holds every customer, even those who haven’t bought anything yet. A slicer on customers shows them all.
  • Another fact table. A “Budgets” table, by month and by product, can be linked to the same Products table as Sales. A single slicer on the brand then filters both the sales and the budgets.
  • Simpler measures. To count the customers, COUNTROWS( Customers ), covered later, is enough.
Tip

For a small one-off analysis, with a few thousand rows and no other table to bring in, a flat table is often enough.

One question remains. How do you actually do this split? Power Query does it for you.

Quiz

The questions often rely on the course tables. Keep them in view in their floating window, which you can move and enlarge.

Question 1

A company adds a “Stores” table, one row per store, with the city and the floor area. What role does it play?

Question 2

The customer Orvane changes name. In a model with a Sales fact table and a Customers dimension table, how many rows need correcting?

Question 3

A company adds a “Budgets” table, with one row per month and per product, and a planned amount. Each month adds new rows. What role does this table play?

Key takeaways
  • A flat table repeats the descriptions on every row. The file gets heavier and Power BI slows down.
  • Microsoft recommends splitting the data into fact tables, which tell about events, and dimension tables, which describe them.
  • Separating facts and dimensions gives a lighter file, descriptions written once and complete lists.