4.1 Star Schema Design
Key Takeaways
- Star schema is the recommended Power BI model design: fact tables surrounded by dimension tables joined one-to-many.
- Fact tables hold numeric measures plus integer foreign keys and are the largest tables; dimensions hold descriptive attributes and a unique key.
- Define the grain (the business event one fact row represents) first; it drives every other modeling decision and prevents double-counting.
- VertiPaq compresses denormalized dimensions efficiently, so flatten snowflake structures into a star in Power Query.
- Star schema minimizes joins, removes relationship ambiguity, and simplifies DAX filter propagation.
Quick Answer: Star schema is the gold standard for Power BI models. A central fact table holds numeric measurements (revenue, quantity, cost) and connects to surrounding dimension tables that supply descriptive context (who, what, when, where). This maximizes DAX performance and report simplicity, and Microsoft explicitly recommends it in the Star schema and the importance for Power BI guidance.
What is a Star Schema?
A star schema is a modeling pattern where a central fact table stores quantitative data (measures), multiple dimension tables surround the fact and provide descriptive context, each dimension connects to the fact through a one-to-many relationship, and the layout resembles a star. The pattern comes from data-warehouse pioneer Ralph Kimball, and Power BI's analytics engine is built to consume it.
The benefit is mechanical, not stylistic. In Power BI, filters flow from the one side (dimension) to the many side (fact). When every dimension sits exactly one hop from the fact, every slicer and axis has a single unambiguous path to the data it filters. Long relationship chains and bridge-heavy designs create multiple paths, forcing bi-directional filtering or USERELATIONSHIP workarounds.
Defining the Grain
Before building, define the grain of the fact table: the precise business event one row represents. "One row per order line" differs from "one row per order" or "one daily product summary." The grain dictates which dimensions attach, which measures are valid, and how detailed reports can be. A frequent mistake is mixing grains in one fact table (order-header values stored on the same row as order-line values), which double-counts measures on aggregation.
Fact Tables
Fact tables contain the numerical measurements your reports analyze.
| Property | Description |
|---|---|
| Grain | Each row represents one event or transaction |
| Measures | Numeric columns aggregated by SUM, AVG, COUNT |
| Foreign Keys | Integer keys that link to dimensions |
| Row Count | Largest table (millions to billions of rows) |
| Shape | Narrow (few columns), very deep (many rows) |
Example: Sales Fact Table
| OrderID | DateKey | ProductKey | CustomerKey | StoreKey | Quantity | UnitPrice | TotalAmount |
|---|---|---|---|---|---|---|---|
| 1001 | 20260301 | P-100 | C-500 | S-10 | 3 | 29.99 | 89.97 |
| 1002 | 20260301 | P-205 | C-312 | S-22 | 1 | 149.00 | 149.00 |
Key columns (DateKey, ProductKey) are foreign keys; measure columns (Quantity, UnitPrice, TotalAmount) are values you analyze.
Types of Fact Tables
| Type | Description | Example |
|---|---|---|
| Transaction | One row per event | Individual sales |
| Periodic Snapshot | One row per period | Monthly account balances |
| Accumulating Snapshot | One row per process lifetime | Order pipeline stages |
| Factless Fact | No measures, tracks events | Student attendance |
Dimension Tables
Dimension tables supply the descriptive context that gives numbers meaning. Each has a primary key (unique per row), descriptive attributes (name, category, address), natural hierarchies (Year > Quarter > Month > Day), and far fewer rows than the fact. Dimensions are wide (many columns) and shallow (few rows).
| Dimension | Key Attributes | Used For |
|---|---|---|
| Date | Year, Quarter, Month, Day, Day of Week | Time intelligence |
| Product | Name, Category, Subcategory, Brand, Color | Product analysis |
| Customer | Name, City, State, Country, Segment | Customer analysis |
| Store/Location | Store Name, City, Region, Manager | Geographic analysis |
| Employee | Name, Department, Title, Hire Date | HR and sales analysis |
Building a Star Schema in Power BI
- Identify the grain of the fact table.
- Identify dimensions by asking who/what/when/where/how: who bought it (Customer), what (Product), when (Date), where (Store), how paid (Payment Method).
- Create relationships in Model view by dragging a dimension key onto the matching fact key; set cardinality to One-to-Many and cross-filter to Single.
- Hide technical columns so report builders filter on friendly dimension attributes, not cryptic keys.
Snowflake vs. Star Schema
| Feature | Star Schema | Snowflake Schema |
|---|---|---|
| Dimension structure | Flat (denormalized) | Normalized sub-dimensions |
| Number of tables | Fewer | More |
| Query performance | Better (fewer joins) | Worse (more joins) |
| Storage | Slightly more raw, compresses well | Less raw |
| Complexity | Simpler | More complex |
| Power BI recommendation | Preferred | Avoid; flatten in Power Query |
Best Practice: Flatten snowflake dimensions into a single table in Power Query. VertiPaq's dictionary and run-length encoding compress repeated dimension values efficiently, so normalization's storage "savings" are largely illusory while the join cost is real.
Model Organization Best Practices
- Arrange tables so the fact sits center and dimensions surround it.
- Hide every foreign key and technical/internal column from report view.
- Create display folders to group measures by business area.
- Mark your date table (Table Tools > Mark as Date Table) so time intelligence works.
- Disable Auto date/time (File > Options > Data Load) to stop hidden per-column date tables from bloating the model.
On the Exam
The PL-300 tests identifying fact vs. dimension tables from a scenario, one-to-many direction (dimension > fact), when to denormalize a snowflake, the role of the date dimension in time intelligence, and hiding technical columns. A common trap: choosing the dimension as the "largest" table; the fact is always largest.
In a star schema, which table typically has the most rows?
What is the primary reason Power BI recommends star schema over snowflake schema?
Why should you define the grain of a fact table before building the model?
Which columns in a fact table should be hidden from report view?