When a Power BI report is slow, shows odd totals, or needs hugely complicated DAX, the cause is very often not the DAX at all. It's the data model. And the single most valuable thing you can do for your model is to shape it as a star schema.
It's the design recommended by Microsoft and by virtually every Power BI professional, and once you understand it, a lot of DAX suddenly becomes simpler.
What you'll learn
- What a star schema is, and the difference between fact and dimension tables
- Why Power BI works best with this design
- How to turn a single flat table into a star schema using Power Query
- Rules for relationships, keys and the Date table
- The most common modeling mistakes
The problem
If you're coming from Excel, you probably keep everything in one big table: one row per sale, with the product name, category, customer, city, country and amounts all side by side.
| OrderID | Date | Product | Category | Customer | Country | Amount |
|---|---|---|---|---|---|---|
| 1001 | 2026-01-05 | Road Bike | Bikes | Asha | India | 1,200 |
| 1002 | 2026-01-06 | Road Bike | Bikes | Ravi | India | 1,200 |
| 1003 | 2026-01-06 | Helmet | Accessories | Asha | India | 45 |
This works in a spreadsheet, but notice how much text is repeated. "Bikes", "India" and "Asha" are stored again on every row. With millions of rows, this causes problems:
- Larger, slower models, because the same descriptive text is stored over and over
- Harder DAX, because a date table, product list or customer list doesn't exist as a separate thing to filter
- Unreliable results, for example when counting customers or products from a table that contains each one many times
The solution
What is a star schema?
A star schema splits your data into two kinds of tables:
- Fact table: one row per event or transaction (a sale, an order line, a click). It contains numbers you measure (quantity, amount) and keys that point to the dimension tables. It is long and narrow.
- Dimension tables: descriptive lists of the things you slice and filter by: products, customers, dates, stores. Each has one row per item and a unique key. They are short and wide.
Draw the fact table in the middle with the dimensions around it and you get a star:
Date
|
| 1
|
Product ------- Sales ------- Customer
1 * * 1
|
| *
|
Store
Each "1" is a dimension (one row per item) and each "*" is the fact table (many rows per item). So one product has many sales, one customer has many sales, and so on.
A concrete example
| Table | Type | Columns |
|---|---|---|
| Sales | Fact | OrderDate, ProductKey, CustomerKey, StoreKey, Quantity, UnitPrice, SalesAmount |
| Product | Dimension | ProductKey, ProductName, Category, Subcategory, Brand |
| Customer | Dimension | CustomerKey, CustomerName, City, Country |
| Store | Dimension | StoreKey, StoreName, Region |
| Date | Dimension | Date, Year, Quarter, Month, Month Number |
Turning a flat table into a star: step by step
Suppose you've loaded one flat query called FlatSales. In Power Query:
- Create the dimension. Right-click
FlatSalesand choose Reference. Keep only the product columns, then remove duplicates (Home → Remove Rows → Remove Duplicates). Rename the queryProduct. - Repeat for Customer, Store and any other descriptive group.
- Slim down the fact table. In
FlatSaleskeep only the key columns and the numeric columns, then rename itSales. - Add the Date table (see the time intelligence post).
- Close and apply, then build relationships in Model view.
The dimension query is just a column selection followed by removing duplicates. In M, that looks like:
let
Source = FlatSales,
ProductColumns = Table.SelectColumns(
Source,
{"ProductID", "ProductName", "Category", "Subcategory"}
),
Product = Table.Distinct(ProductColumns)
in
Product
Make sure each dimension has a unique key column. If your data has no natural ID, add an Index column in Power Query and use it as the key in both the dimension and the fact table.
Create the relationships
In Model view, connect each dimension key to the matching key in the fact table (Product[ProductKey] to Sales[ProductKey], and so on). Every relationship should be one-to-many (dimension on the "one" side), with filtering set to single direction.
The payoff: your DAX stays simple. This one measure works with any slicer, whether it's a product, customer, store or date:
Total Sales = SUM ( Sales[SalesAmount] )
How it works
Why Power BI loves star schemas
- Filters flow in one direction. When you select "Bikes" in a Product slicer, the filter travels from the Product table (the "one" side) down to Sales (the "many" side). Your measures then see only bike sales. It's predictable, and it's how every DAX filter pattern is designed to work.
- Better compression. Power BI stores each column separately and compresses repeated values. Descriptive text lives once per product or customer in a small dimension instead of repeating on every sales row, which typically means smaller, faster models.
- Simpler measures. Counting customers, listing products without sales, or building time comparisons all work naturally when each concept has its own table.
| One flat table | Star schema | |
|---|---|---|
| Repeated text | On every row | Once per dimension row |
| Model size and speed | Larger and slower on big data | Smaller and faster |
| Slicers and filters | Built from the big table | Built from small dimensions |
| DAX complexity | Often needs workarounds | Simple, standard patterns |
| Reuse for new fact tables | Hard | Easy: share the same dimensions |
Design rules checklist
- Facts: numeric measures plus foreign keys. No long descriptive text.
- Dimensions: a unique key, plus the descriptive columns people filter and group by.
- Relationships: one-to-many, single direction, from dimension to fact.
- Keys: same data type on both sides (integers are best). Hide key columns from the report view.
- One Date table, marked as a date table, shared by all facts.
- Flatten snowflakes. If Product links to Subcategory, which links to Category, merge them into one Product dimension.
- Hide the fact table's raw columns and expose measures instead.
When one date column isn't enough
Often a fact table has several dates, such as OrderDate and ShipDate. Don't create a second Date table. Relate both to the same one: one relationship stays active (usually OrderDate), the other is inactive. Then activate it inside a measure only when you need it:
Sales by Ship Date =
CALCULATE (
[Total Sales],
USERELATIONSHIP ( Sales[ShipDate], 'Date'[Date] )
)
This pattern is called a role-playing dimension: the same Date table plays a different role depending on the measure.
Common mistakes
- Keeping everything in one flat table. The most common beginner model. It works on small data and then slows down as it grows.
- Leaving dimensions "snowflaked". Chains of lookup tables (Product → Subcategory → Category) add relationship hops and confuse users. Merge them into one dimension.
- Setting bidirectional filtering everywhere. It seems to fix filtering problems, but it can create ambiguous paths, slow performance and unexpected results. Keep single direction unless you have a specific reason.
- Linking fact tables directly to each other. If you have Sales and Budget, connect both to shared dimensions (Date, Product), not to each other.
- Duplicate or blank keys in a dimension. A dimension key must be unique. Duplicates break the one-to-many relationship, and keys in the fact table that have no match show up under a "(Blank)" row in your visuals.
- Mismatched data types on keys. A text key on one side and a number on the other will not relate correctly. Make sure both sides use the same type.
Key takeaways
- A star schema has one fact table (events and numbers) surrounded by dimension tables (descriptions).
- Relationships should be one-to-many, with filters flowing from dimensions to the fact table.
- Split flat tables into facts and dimensions in Power Query, not in DAX.
- A good model makes your DAX shorter, your reports faster and your numbers more trustworthy.
Related posts
Not sure how to split your own data? Describe your columns in the comments and I'll suggest which ones belong in the fact table and which in dimensions.