Domain 3 β€” Module 2 of 8 25%
23 of 29 overall
Domain 3: Implement and Manage Semantic Models Free ⏱ ~14 min read

Relationships & Advanced Modeling

Bridge tables, many-to-many relationships, role-playing dimensions β€” master the relationship patterns that the exam loves to test.

Relationships in semantic models

Simple explanation

Think of relationships as bridges between islands.

Each table in your semantic model is an island. To get data from one island (Sales) to another (Products), you need a bridge (relationship). The bridge has a direction (one-way or two-way), a width (one-to-many or many-to-many), and rules about who can cross (filter direction).

In a star schema, the fact table is the central island with bridges to each dimension. Advanced patterns add extra bridges for special cases β€” bridge tables, role-playing dimensions, and many-to-many relationships.

Relationship properties

Every relationship has four properties:

PropertyOptionsDefault
CardinalityOne-to-many, Many-to-one, One-to-one, Many-to-manyOne-to-many
Cross-filter directionSingle, BothSingle
ActiveYes / NoYes (only one active per pair)
Assume referential integrityYes / NoNo

Cross-filter direction

  • Single (default) β€” filters flow from the β€œone” side to the β€œmany” side. Dimension filters the fact table.
  • Both (bidirectional) β€” filters flow both ways. Use cautiously β€” can cause ambiguity and performance issues.
Exam tip: Bidirectional filtering dangers

The exam loves to test when bidirectional filtering goes wrong:

  • Ambiguous paths β€” if table A can filter table C through two different bidirectional paths, the engine cannot determine which path to use
  • Performance β€” bidirectional filters create more complex query plans
  • Unexpected results β€” a filter on a fact table can propagate back to filter dimensions, giving wrong counts

Rule of thumb: use single direction (dimension β†’ fact) unless you have a specific, justified reason for bidirectional.

Many-to-many relationships

When two tables have a many-to-many relationship (e.g., students and courses, products and promotions), you need a bridge table.

The bridge table pattern

Products ←→ ProductPromotions ←→ Promotions
(many)       (bridge table)        (many)

The bridge table contains one row for each combination:

product_keypromotion_key
101501
101502
102501
103503

Relationship setup

  1. Products β†’ ProductPromotions (one-to-many on product_key)
  2. Promotions β†’ ProductPromotions (one-to-many on promotion_key)
  3. Bidirectional on both relationships (so filters propagate through the bridge)
Scenario: Anita's promotional analysis

Anita at FreshCart has a many-to-many relationship between products and promotions β€” one product can be in multiple promotions, and one promotion covers multiple products.

She creates a bridge_product_promotion table and sets up two one-to-many relationships:

  • dim_product β†’ bridge_product_promotion (filter from product to bridge)
  • dim_promotion β†’ bridge_product_promotion (filter from promotion to bridge)

With bidirectional filtering enabled, selecting β€œEaster Sale” in a report filter shows only the products in that promotion, and selecting β€œOrganic Avocado” shows only the promotions it participated in.

Role-playing dimensions

A role-playing dimension is a single dimension table used in multiple relationships with the same fact table. The most common example: a date dimension.

Example: Order date vs ship date vs delivery date

A fact table with three date columns needs three relationships to the date dimension:

RelationshipFact ColumnDim ColumnActive?
Order Datefact_orders.order_date_keydim_date.date_keyActive
Ship Datefact_orders.ship_date_keydim_date.date_keyInactive
Delivery Datefact_orders.delivery_date_keydim_date.date_keyInactive

Only ONE relationship between two tables can be active. The others are inactive and must be activated explicitly in DAX using USERELATIONSHIP:

ShipDateRevenue =
CALCULATE(
    [Total Revenue],
    USERELATIONSHIP(fact_orders[ship_date_key], dim_date[date_key])
)
Exam tip: USERELATIONSHIP

The exam frequently tests USERELATIONSHIP. Remember:

  • Only one relationship per table pair can be active at a time
  • USERELATIONSHIP activates an inactive relationship within a CALCULATE context
  • The function takes the foreign key column and the primary key column as arguments
  • It only works inside CALCULATE (not in regular expressions)

Star schema in semantic models vs physical storage

In Module 8 (Star Schema Design), you built the physical star schema in a lakehouse or warehouse. Here, you implement the same pattern as relationships in the semantic model.

AspectPhysical (Lakehouse/Warehouse)Semantic Model
Star shapeFact + dimension tables stored as Delta/SQLTables connected by relationships
JoinsSQL JOIN clausesAutomatic via relationships
DenormalizationFlatten hierarchies in SQLFlatten or handle with hierarchies
PerformanceColumnar storage, aggregate tablesVertiPaq compression, relationship optimization
Business logicSQL views and stored proceduresDAX measures and calculation groups
Question

What is a bridge table?

Click or press Enter to reveal answer

Answer

A bridge table resolves a many-to-many relationship by sitting between two dimension tables. It contains one row per combination (e.g., product_key + promotion_key). Each dimension has a one-to-many relationship to the bridge table, with bidirectional filtering to propagate filters through.

Click to flip back

Question

What is a role-playing dimension?

Click or press Enter to reveal answer

Answer

A dimension table that participates in multiple relationships with the same fact table. Example: dim_date used as order date, ship date, and delivery date. Only one relationship can be active β€” others are inactive and activated with USERELATIONSHIP in DAX.

Click to flip back

Question

What does USERELATIONSHIP do?

Click or press Enter to reveal answer

Answer

USERELATIONSHIP activates an inactive relationship within a CALCULATE expression. Syntax: CALCULATE([Measure], USERELATIONSHIP(FK_column, PK_column)). Required when a role-playing dimension has multiple relationships and you need to use a non-default one.

Click to flip back

Knowledge Check

Anita at FreshCart has a fact_orders table with order_date_key, ship_date_key, and delivery_date_key β€” all referencing dim_date. Only the order_date relationship is active. She needs a measure for revenue by ship date. What should she do?

Knowledge Check

Dr. Sarah at Pacific Health has patients who can be assigned to multiple care teams, and each care team has multiple patients. What relationship pattern should she use in her semantic model?


Next up: DAX Essentials: Variables & Functions β€” master DAX iterators, table filtering, windowing, and information functions.