Managing Relationships: 1:1, 1:Many & Many:Many Gotchas
Overview & Learning Objectives
Dimensional models come in two main flavors: Star Schemas and Snowflake Schemas. In a Star Schema, each dimension is a single flat table connected directly to the central Fact table (resembling a star). In a Snowflake Schema, dimensions are normalized into sub-dimension tables (e.g., Product links to Subcategory, which links to Category). Microsoft officially recommends the Star Schema for all Power BI reporting.
- Compare Star Schema and Snowflake Schema structures and performance trade-offs.
- Understand why the VertiPaq engine calculates DAX faster on Star Schemas.
- Flatten normalized sub-dimensions in Power Query to convert Snowflake schemas into Star Schemas.
Industry Standard
Standard: Microsoft's official Power BI architecture documentation explicitly states: "Star Schema is the mature design approach widely adopted by relational data warehouses. It is the best practice schema design for Power BI."
Real-World Example: Burger Point Quick Service Chain
Burger Point has a central Fact_Sales table. In Snowflake schema, Products link to SubCategories, which link to Categories. In Star Schema, all are flattened into Dim_Product.
| Schema Type | Dimension Structure | Relationship Hops to Fact | DAX Performance |
|---|---|---|---|
| Star Schema | Dim_Product (contains Product, Subcat, Cat) | 1 hop directly to Fact_Sales | Maximum Speed (Recommended) |
| Snowflake Schema | Dim_Product -> Dim_Subcat -> Dim_Category | 3 relational hops to Fact_Sales | Slower (More relationship joins) |
Syntax & Core Workflow
Transform in Power Query: Open Dim_Product -> Merge Queries with Dim_Subcategory on SubcategoryID -> Expand Category -> Load as single Star Dimension
Parameters Breakdown
Star Schema: Central Fact table surrounded by flat, single-hop Dimension tables with no normalized sub-tables.Snowflake Schema: Dimension tables broken down into normalized parent-child sub-dimensions (multi-hop relationships).Relationship Hop: The traversal a filter context must make across foreign keys to reach the fact table.Denormalization: Collapsing related sub-dimension lookup tables into a single table in Power Query.
Sample Walkthrough (Q&A)
Question: Why does VertiPaq prefer a denormalized Star Schema over a 3NF normalized Snowflake schema?
Formula / Action: Single-hop filtering evaluates fewer table joins during DAX measure execution.
Result: Sub-second visual response times and simplified DAX formulas.
Explanation: In transactional databases (OLTP), normalization prevents write redundancy. But Power BI is an analytical engine (OLAP). Joining across multiple relationship hops slows down the VertiPaq engine and makes DAX formulas like RELATEDTABLE more complex.
Common Mistakes & Limitations
- Importing raw 3rd Normal Form (3NF) relational database tables straight into Power BI without flattening them into a Star Schema.
- Creating circular relationship loops across multiple snowflake dimension branches.
Keyboard Shortcuts
| Action | Windows | Mac |
|---|---|---|
| Auto-arrange Model Layout | Click "Auto-arrange" in Model View ribbon | Click "Auto-arrange" |
| Collapse Table in Model View | Click chevron at table header in Model View | Click chevron |
Pro Tips & Modern Alternatives
- Use Power Query Merge Queries to fold subcategories and categories directly into the primary product dimension table.
- Create dedicated Model View layout tabs for specific business processes (e.g. Sales Star, Inventory Star).