Sub topic 8
Alternative: Separate Date Tables for Each Role
This chapter covers the second way to handle a role-playing dimension: give each role its own Date table. It assumes you can already read a star schema diagram, create relationships in the model view, and write simple measures with CALCULATE. You should also know that a model can hold only one active relationship between two tables, and that USERELATIONSHIP activates an inactive one for a single calculation.
The idea in one paragraph
A role-playing dimension is one physical table used in several roles. In the Sales model, the Date table plays the order date, ship date, and due date roles. With USERELATIONSHIP, all roles share one table, and the measure picks which relationship to use. The alternative is to copy the Date table once per role. Each copy gets its own active relationship to one date column in the fact table. Nothing needs to be switched on inside a measure, because every relationship is already active.
The copy is usually called a duplicate dimension. Some data modelers call the result a "role-specific" dimension, because each copy carries only one role.
Why the duplicate approach works
The rule that limits you is about pairs of tables. Power BI and Analysis Services allow only one active relationship between any two tables, because two active paths would make the filter ambiguous. If Sales is related to Date by two active relationships, a filter on Date would not say which Sales column it should filter.
A duplicate sidesteps the rule. Sales and Ship Date are a different pair of tables from Sales and Date. The pair Sales to Ship Date has exactly one relationship, and it is active. The model has no ambiguity, so no relationship needs to be inactive.
Creating the duplicate
There are three common ways to produce the copy. They differ in how the copy stays up to date and how much memory it uses.
| Method | How it works | Notes |
|---|---|---|
| DAX calculated table | `Ship Date = 'Date'` | Simple. The copy is recomputed on refresh and is stored in the model, so it uses memory. |
| Power Query reference or duplicate | Create a new query from the Date query | Keeps the logic in the data preparation layer. Easy to rename columns for each role. |
| Source table or view | Load the same table or view again | Best when the Date table already comes from a warehouse. |
The simplest option is the calculated table from the topic's examples:
Ship Date = 'Date'This creates a table named Ship Date with the same columns and rows as 'Date'. You then create a relationship from Sales[ShipDate] to 'Ship Date'[Date]. It is a many-to-one relationship, and it is active by default, because no other relationship exists between those two tables.
A calculated table copies the data but not everything attached to the original. Check these items after you create it:
- Date table marking. The copy is not automatically marked as a date table. Mark it yourself on the
Datecolumn if you want time intelligence functions to work on it. - Sort-by-column settings. A month name column sorted by month number in the original may need its sort order set again in the copy.
- Hierarchies, formatting, and descriptions. These are not carried over reliably. Verify them.
- Hidden columns and display folders. Recheck them the same way.
Since the copy is a separate table, it also needs the same column names to make sense to report authors. A report with a slicer named Year from three tables is confusing. The next section deals with that.
Make the roles readable
With three copies of the same columns, a field list shows Year three times. Rename the columns or the tables so the role is clear.
- Name each table after its role:
Order Date,Ship Date,Due Date. - Consider prefixing columns, for example
Ship Year,Ship Month, andShip Month Number. Prefixes help when a visual shows fields from several tables, because the axis title carries the role. - Hide the raw date key column in
Sales(OrderDate,ShipDate,DueDate) so report authors use the Date tables rather than the fact columns.
If you build the copies in Power Query, you can rename the columns once in a shared step. With a calculated table, you rename them in the model after creation, or you build the table with SELECTCOLUMNS so the names are set in the expression:
Ship Date =
SELECTCOLUMNS (
'Date',
"Ship Date", 'Date'[Date],
"Ship Year", 'Date'[Year],
"Ship Month Number", 'Date'[Month Number],
"Ship Month", 'Date'[Month]
)This version lists the columns explicitly, so it only keeps the ones you name. If the original Date table gains a column later, you must add it here too.
Writing measures
With the duplicate in place, the measures need no special function. The base measure from earlier in the tutorial is unchanged:
Sales Amount = SUM ( Sales[SalesAmount] )What changes is which table you filter. A visual that puts 'Order Date'[Year] on the axis shows sales by order year. A visual that puts 'Ship Date'[Year] on the axis shows the same measure by ship year. The measure itself is the same, because the relationship attached to each Date table decides which Sales column is filtered.
Time intelligence also works directly. If Ship Date is marked as a date table, a year-to-date measure uses it as an argument:
Shipped Sales YTD =
CALCULATE (
[Sales Amount],
DATESYTD ( 'Ship Date'[Date] )
)Compare this to the USERELATIONSHIP version, which needs a second filter argument naming the relationship. Here the filter on 'Ship Date' already flows through its active relationship.
Using two roles in one visual
A real advantage of duplicates is that two roles can filter the same visual at once. Suppose a matrix has 'Order Date'[Year] on rows and 'Ship Date'[Year] on columns. Each cell then shows the sales amount for orders placed in one year and shipped in another year. For example, it can show orders placed in December and shipped the next January.
The filters from both Date tables reach Sales and combine as an intersection. Only rows that satisfy both conditions are summed.
With a single Date table, this view is hard to build. The slicer or axis is attached to one table, and a measure with USERELATIONSHIP activates a different relationship in its own filter. You can calculate such cross-role figures in DAX, but report authors cannot simply drag two fields into a visual.
The same applies to slicers. A page can offer an order-year slicer and a ship-year slicer side by side, and users can combine them.
What you give up
Duplicating a dimension is not free. Consider these costs before choosing it.
- Model size. Each copy adds rows and columns. A Date table is small, often a few thousand rows, so the cost is usually negligible. The cost becomes real when the shared dimension is large, such as a customer table with millions of rows. Duplicating it for a "bill-to" and a "ship-to" role can double memory use.
- Maintenance. A change to the original, such as a new fiscal-year column, must be repeated in every copy. A calculated table that refers to the whole original (
= 'Date') picks up new columns automatically. A SELECTCOLUMNS copy or a Power Query copy with renamed columns does not. - Model clutter. Three Date tables in the field list are harder to navigate than one. Hiding unneeded columns and using clear names helps, but the list still grows.
- Measure count. If you want a "ship date" version of a measure to appear next to an "order date" version, you do not need to write one. The user chooses the table. However, a report author must know to pick the right table. A measure named
Shipped Sales YTDis self-describing. A genericSales Amounton aShip Dateaxis is not, unless the axis title makes the role obvious. - Cross-filtering between Date tables. The Date copies do not filter each other. Selecting 2025 on
'Order Date'does not restrict the'Ship Date'slicer. Every slicer still shows all of its years, even if some combinations have no sales. That can look strange to users.
Role-playing in the other direction
Duplication is also the standard answer when the role-playing table is not a Date table. Consider an Airport dimension used by a Flights fact table for both origin and destination. You could use one Airport table with an inactive relationship and USERELATIONSHIP, or you could create Origin Airport and Destination Airport. A report that shows flights from one airport to another needs both filters at once, so the duplicate approach fits it naturally.
The same trade-off applies. Airport tables are small, so duplication is cheap. A table of a million customers would call for more care.
A worked comparison
The model has Sales with OrderDate, ShipDate, and DueDate. A report author wants one chart of sales by ship month. Here is the work for each approach.
- USERELATIONSHIP. Write
Sales Amount by Ship Datewith USERELATIONSHIP, then put'Date'[Month]on the axis and the new measure in the values. The author must pick the right measure. UsingSales Amountinstead gives sales by order month with the same axis, which looks correct but is wrong. - Duplicate tables. Put
'Ship Date'[Ship Month]on the axis andSales Amountin the values. No new measure is needed, and the axis field names the role.
For a single chart, the duplicate approach is fewer steps. The USERELATIONSHIP approach pays off as the number of roles and measures grows, because the model stays smaller, and a measure can state its role in its name.
Common problems with duplicates
The new relationship is inactive. If you create a relationship from Sales[ShipDate] to 'Ship Date'[Date] and the model shows it as inactive, another active relationship probably already exists between the same two tables. That happens if you duplicated the table and also connected the original by mistake. Delete the extra relationship.
Time intelligence functions return an error or odd results. Time intelligence needs a contiguous date column with no gaps, and the table should be marked as a date table. If you created Ship Date from the original, confirm that the copy is marked.
Visuals show blanks. A Date copy may contain dates that have no matching Sales rows, which is normal. Blank rows appear in the other direction when Sales holds a date that is missing from the copy. Because the copy is derived from the original, a date missing in one is usually missing in both. Extend the original so it covers every date in every date column of the fact table, including DueDate, which often reaches further into the future than OrderDate.
A slicer on one Date table does not affect another. This is expected, as described above. If users want linked behavior, use one Date table with a measure-based approach or a calculation group instead.
Summary of when duplication fits
Duplicate dimension tables fit best when these conditions hold.
- Report authors need to use two roles in one visual or on one page at the same time.
- The dimension is small, so extra copies cost little memory.
- You want report authors to build visuals without learning which measure to use.
- The number of roles is small and stable.
Prefer USERELATIONSHIP when the dimension is large, when roles are many, or when you want a measure's name to carry the role. The next chapter covers calculation groups, which keep one Date table and let users switch the role with a selection rather than a separate measure per role.
Exercise
A model has a Sales table with OrderDate and ShipDate. You create the calculated table Ship Date = 'Date' and add a relationship from Sales[ShipDate] to 'Ship Date'[Date]. Is that relationship active, and why? Then write the measure that returns year-to-date sales by ship date, assuming 'Ship Date' is marked as a date table.
Show answer
It is active, because the pair Sales and 'Ship Date' has no other relationship, so the one-active-relationship rule is not violated. The measure is: Shipped Sales YTD = CALCULATE ( [Sales Amount], DATESYTD ( 'Ship Date'[Date] ) ). No USERELATIONSHIP is needed, because the filter on 'Ship Date' reaches Sales through its active relationship.
Exercise
Give two reasons you might choose duplicate Date tables over USERELATIONSHIP, and one reason you might not.
Show answer
For: a visual or page can filter by order date and ship date at the same time, and report authors do not need a separate measure per role. Against: each copy must be maintained and, for a large dimension, it adds memory use. Other acceptable reasons against are that slicers on the copies do not filter each other, and that the field list gets longer.
Exercise
A matrix shows 'Order Date'[Year] on rows and 'Ship Date'[Year] on columns, with [Sales Amount] as the value. What does the cell for row 2025 and column 2026 show?
Show answer
The total sales amount for rows in Sales whose order date falls in 2025 and whose ship date falls in 2026, because the filters from the two Date tables combine as an intersection.