Star Schema
Why Power BI models should be star schemas: fact and dimension tables, the relationship pattern, why flat tables cause problems, and how it makes DAX simpler.
Star Schema Design
A star schema is the recommended data modeling pattern for Power BI.
It organizes data into:
- A central fact table containing business events.
- Multiple dimension tables containing descriptive information.
The structure resembles a star:
The fact table sits in the center.
Dimension tables surround the fact table and provide context for analysis.
Why Use a Star Schema?
A well-designed star schema improves:
- Report performance
- DAX simplicity
- Data consistency
- Model maintainability
- User understanding
Power BI works best when the model structure matches the business process.
Example:
A sales process contains:
- Customers purchasing products
- Products being sold
- Sales occurring on specific dates
- Transactions happening at locations
A star schema represents these business events clearly.
Star Schema Components
A Power BI star schema contains two main table types:
Fact Tables
Fact tables store measurable business events.
Examples:
- Sales transactions
- Production output
- Inventory movements
- Service calls
Example:
FactSales
SalesKey
DateKey
CustomerKey
ProductKey
Quantity
SalesAmountFact tables usually contain:
- Numeric values
- Transaction records
- Foreign keys
Dimension Tables
Dimension tables describe the business entities connected to facts.
Examples:
DimDate
DimCustomer
DimProduct
DimStoreThey contain descriptive attributes used for:
- Filtering
- Grouping
- Slicing reports
Example:
DimProduct
ProductKey
ProductName
Category
BrandRelationship Pattern
Star schemas typically use one-to-many relationships.
Example:
DimProduct
|
| 1 : Many
|
FactSalesThe dimension table contains unique values.
The fact table contains repeated transactions.
Example:
DimProduct:
| ProductKey | ProductName |
|---|---|
| 1001 | Tire A |
| 1002 | Tire B |
FactSales:
| ProductKey | Quantity |
|---|---|
| 1001 | 10 |
| 1001 | 5 |
| 1002 | 8 |
The relationship allows Power BI to filter sales by product.
Star Schema vs Flat Tables
A common mistake is storing everything in one large table.
Example:
SalesData
Date
Customer Name
Customer Region
Product
Category
Quantity
Sales Amount
StoreProblems:
- Duplicate information
- Larger file size
- More difficult DAX
- Poorer model performance
A star schema separates these responsibilities.
Example:
DimCustomer
CustomerKey
CustomerName
Region
FactSales
CustomerKey
ProductKey
DateKey
SalesAmount
DimProduct
ProductKey
ProductName
CategoryBenefits for DAX
Star schemas make DAX easier because filter context flows predictably.
Example:
Total Sales =
SUM(FactSales[SalesAmount])A user selecting:
Category = "Off Road"automatically filters:
DimProduct
|
v
FactSalesThe measure returns only matching sales.
Star Schema Best Practices
Follow these guidelines:
- Keep one fact table for each business process.
- Use dimension tables for filtering.
- Avoid unnecessary relationships.
- Create clear table names.
- Use surrogate keys when appropriate.
- Keep dimensions independent.
Recommended naming:
FactSales
FactInventory
DimDate
DimProduct
DimCustomerCommon Modeling Mistakes
Avoid:
Multiple Fact Tables Without Purpose
Example:
Sales
Sales_New
Sales_Final
Sales_UpdatedThis creates confusion and inconsistent reporting.
Direct Fact-to-Fact Relationships
Avoid:
FactSales
|
FactInventoryInstead use shared dimensions:
DimDate
|
FactSales FactInventoryNext Steps
Continue learning Power BI data modeling:
- Fact Tables
- Dimension Tables
- Relationships
- CROSSFILTER() — temporarily overriding a relationship's filter direction in DAX
- Date Tables
Advanced Topics:
See it applied end to end: Build a Complete Sales Analysis Report builds this exact pattern from a raw CSV export through to a finished report, Build a Product Usage Dashboard on a Fabric Lakehouse for the same shape built with a Fabric notebook and Direct Lake instead, or Build a Risk Register and Risk Matrix Dashboard for a star schema paired with a "latest value per entity" DAX pattern.
Introduction to Data Modeling
Why the data model matters in Power BI, the common dimension tables, naming conventions, and the modeling mistakes that cause wrong numbers and slow reports.
Fact Tables
The three kinds of fact table (transaction, periodic snapshot, and accumulating snapshot), how to key them, and the design mistakes that make measures harder.