Stop 06 · Data ModelingTopics · 8/9

Role-Playing Dimensions

Part of the Power BI Roadmap

In short

The same Date table needs to answer "sales by order month", "sales by ship month" and "sales by delivery month". One dimension, several roles. There are two clean ways to handle it.

A role-playing dimension is one table used in several roles, like a Date table acting as Order Date, Ship Date and Delivery Date. You handle it with inactive relationships or with separate copies of the table.

The jaadu stands backstage in front of a mirror, swapping between a crown, a gardener's straw hat and a postman's cap hanging on hooks.

Think of it like this

One actor, many roles

In a school play, one student plays the king in Act 1 and the gardener in Act 3. Same person, different costume. A Date table plays Order Date in one visual and Ship Date in another.

Watch it happen

Two ways to play the roles

One table + inactive links

  • Single Date table
  • OrderDate active, ShipDate inactive
  • USERELATIONSHIP in measures
  • Fewer tables, more measures

Copies of the table

  • Order Date and Ship Date tables
  • Each with an active relationship
  • Users pick the role by slicer
  • More tables, simpler measures

Use inactive relationships for occasional roles. Use copies when users need to slice by both roles in the same report.

The big ideas

What you need to know

Same dimension, different meaning

Date is the classic case. Others: City as billing city and delivery city, or Employee as salesperson and manager.

Option 1: USERELATIONSHIP

Keep one table and write role-specific measures that activate the right relationship.

Option 2: copies

Reference the Date query in Power Query to make a Ship Date table and rename its columns, like Ship Month.

Rename clearly

With copies, prefix columns so a user never confuses Order Month with Ship Month.

See it in code

Walk through the code

dax
1Sales Amount = SUM ( Sales[Amount] )2 3Sales by Ship Date =4CALCULATE ( [Sales Amount], USERELATIONSHIP ( Sales[ShipDate], 'Date'[Date] ) )5 6Sales by Delivery Date =7CALCULATE ( [Sales Amount], USERELATIONSHIP ( Sales[DeliveryDate], 'Date'[Date] ) )8 9Avg Days to Deliver =10AVERAGEX ( Sales, DATEDIFF ( Sales[OrderDate], Sales[DeliveryDate], DAY ) )

1/4The base measure uses the active OrderDate relationship.

Option 1: one Date table, one measure per role, plus a measure that uses two date columns at once.

Save yourself the pain

Common mistakes

Oops

Making copies of the Date table but leaving column names identical.

Do this instead

Rename columns in each copy, like Ship Year and Ship Month, so fields are clear.

Oops

Expecting a slicer on Date to filter Sales by Ship Date in plain measures.

Do this instead

Plain measures use the active relationship. Only the USERELATIONSHIP measures respond via ShipDate.

Your mission

Three date roles

~25 min

Quick check

Users want two slicers on one page: Order Month and Ship Month, both filtering sales. Which approach fits best?

Go deeper

  1. 1List every date column in your fact table and the question each one answers.
  2. 2Try the inactive relationship approach first.
  3. 3Create a second Ship Date table and compare which approach is easier for report users.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge