Sub topic 2
How an Active Relationship Filters the Fact Table
This chapter assumes you know the basics of Power BI or Tabular modeling, star schemas, one-to-many relationships, simple DAX measures such as SUM, and the idea of filter context. It explains how a filter travels from the Date table to the Sales table when the relationship is active. Later chapters build on this when a second date column enters the model.
The model used in this chapter
The examples use a small star schema. Sales is the fact table. It has three date columns: OrderDate, ShipDate, and DueDate. 'Date' is the dimension table, with one row per calendar day.
Each date column in Sales can relate to 'Date'[Date]. Suppose the active relationship is Sales[OrderDate] to 'Date'[Date]. The relationship is many-to-one from Sales to 'Date'. The filter direction is single, from 'Date' to Sales.
The base measure is:
Sales Amount = SUM ( Sales[SalesAmount] )This measure contains no date logic. The date logic comes from the relationship.
Following one filter
Say a report shows a matrix with 'Date'[Year] on the rows and [Sales Amount] as the value. For the row 2025, the engine does these steps:
- It creates a filter context on
'Date'[Year]equal to 2025. Only the'Date'rows from 2025 remain visible. - It follows the active relationship from
'Date'[Date]toSales[OrderDate]. OnlySalesrows whoseOrderDatematches a visible date remain. - It evaluates
SUM ( Sales[SalesAmount] )over those rows.
The measure never mentions OrderDate. The model supplies it.
Why the filter goes one way
In the one-to-many relationship, the 'Date' side is the "one" side and Sales is the "many" side. With single-direction filtering, a filter on the one side reaches the many side. A filter on Sales does not reach 'Date'.
This explains a common observation. If you slice by Sales[Region], the 'Date' table still shows all of its rows. Only slicers or visuals based on 'Date' columns narrow the Sales rows.
What happens to the other date columns
Only the active relationship carries the filter. If Sales[ShipDate] also relates to 'Date'[Date], that relationship is inactive. The engine ignores it when it resolves filters.
A matrix by 'Date'[Year] therefore shows sales by order year, even though ShipDate is also related to the same table. The ship date column is stored in Sales, but it never receives the year filter.
The next table compares the two roles.
| Relationship | State | Used by default | Effect of a year filter |
|---|---|---|---|
| `Sales[OrderDate]` to `'Date'[Date]` | Active | Yes | Filters sales by order year |
| `Sales[ShipDate]` to `'Date'[Date]` | Inactive | No | No effect on `Sales` |
Checking which relationship is active
In Power BI Desktop, open Model view. An active relationship appears as a solid line. An inactive one appears as a dashed line. You can also open the Manage relationships dialog and check the Active column.
You can test the behavior with a query. Run this in DAX query view:
EVALUATE
SUMMARIZECOLUMNS (
'Date'[Year],
"Sales Amount", [Sales Amount]
)
ORDER BY 'Date'[Year]Each year's total uses OrderDate. If you compare this to a sum grouped by YEAR ( Sales[ShipDate] ), the numbers differ for orders that ship in a later year than they were placed.
Common mistakes
- Assuming the measure "knows" which date to use. It does not. It uses whichever relationship is active when it runs.
- Expecting a filter on
Sales[ShipDate]to filter the'Date'table. The filter direction is from'Date'toSales. - Changing the active relationship in the model to answer one question. This changes every measure and visual that uses
'Date'.
Summary of the mechanism
A relationship is the path a filter takes. Active relationships are the paths the engine uses automatically. Inactive relationships exist in the model but stay unused until a calculation asks for one by name.
Exercise
A model has Sales[OrderDate] as the active relationship to 'Date'[Date], and Sales[ShipDate] as an inactive relationship to the same column. A matrix shows 'Date'[Year] on rows and [Sales Amount] = SUM ( Sales[SalesAmount] ) as the value. An order was placed on 2025-12-29 and shipped on 2026-01-03. Which year row includes this order's amount, and why?
Show answer
The 2025 row. The active relationship uses OrderDate, so the year filter on 'Date' reaches Sales through OrderDate. The inactive ShipDate relationship is ignored, so the ship year 2026 plays no part.
Exercise
You select a single region in a slicer based on Sales[Region]. Why does the 'Date' table still show all its dates?
Show answer
The relationship filters from the "one" side ('Date') to the "many" side (Sales). A filter on Sales does not propagate back to 'Date' with single-direction filtering.