Sub topic 11
Active and inactive relationships
This chapter assumes you can create a relationship in the Model view and that you know what a fact table, a dimension table and a measure are. It covers why a model can hold more than one relationship between two tables, and how to use the one that is not active.
Why only one relationship is active
Power BI allows several relationships between the same two tables. Only one of them can be active at a time. The active relationship is the one that filters by default. The others are inactive and do nothing until a measure asks for them.
Take a Sales table with two date columns, OrderDate and ShipDate. Both can relate to 'Date'[Date]. If both were active, a slicer on 'Date' would not know which column to filter. That is an ambiguous path, so Power BI keeps only one active.
In the Model view, an active relationship is drawn as a solid line. An inactive one is drawn as a dashed line.
Setting a relationship active or inactive
- Open Manage relationships on the Home tab, or double-click the line in the Model view.
- Select the relationship and choose Edit.
- Select or clear the Make this relationship active check box.
- Select OK.
Power BI will not let you activate a relationship if that would create an ambiguous path. It deactivates one of them or shows an error.
Using an inactive relationship in a measure
USERELATIONSHIP switches on an inactive relationship for the duration of one CALCULATE. Name the two columns of the relationship you want.
Total Sales = SUM ( Sales[SalesAmount] )
Sales by Ship Date =
CALCULATE (
[Total Sales],
USERELATIONSHIP ( Sales[ShipDate], 'Date'[Date] )
)Inside Sales by Ship Date, the ShipDate relationship is active and the OrderDate relationship is paused. Other measures still use OrderDate. Place both measures in one matrix by month and you can compare sales by order month with sales by ship month.
Common errors
- The two measures show the same numbers. The relationship you named in
USERELATIONSHIPmay already be active, or you may have named the wrong columns. Check the Model view. - A "cannot find relationship" error.
USERELATIONSHIPworks only on an existing relationship. Create it first and mark it inactive. - Slicer on the date table ignores ship dates. The slicer uses the active relationship. Only measures that call
USERELATIONSHIPuse the inactive one. - Row-level security conflicts. Security rules on a table can restrict which relationships you can activate in a measure. Test the measure under each role.
Exercise
A model has an active relationship from Sales[OrderDate] to 'Date'[Date] and an inactive one from Sales[ShipDate] to 'Date'[Date]. A card visual shows [Total Sales] for 2026 using a year slicer. Which date column does the slicer filter, and how would you get the same card by ship date?
Show answer
The slicer filters by OrderDate, because that relationship is active. To filter by ship date, write a measure that wraps [Total Sales] in CALCULATE with USERELATIONSHIP ( Sales[ShipDate], 'Date'[Date] ), and show that measure on the card.