Relationships in Power BI
Relationships connect the tables of the model. Filters from slicers, rows and axes flow through them into the fact table. Here you create relationships and learn why only one can be active between two tables.
In short: a relationship connects a column of the fact table with the key of a dimension. Between two tables at most one relationship is active (solid line); others are inactive (dashed) and only used in measures with USERELATIONSHIP.
Prerequisites: Star schema.
Try it now
Task Product and Region are connected, the date table is not yet. Connect Sales[OrderDate] to 'Date'[Date] so the matrix shows sales per year.
Sales 120 rows, 7 columns
| OrderID | OrderDate | ShipDate | ProductID | RegionID | Quantity | Amount |
|---|---|---|---|---|---|---|
| 1 | 3 Oct 2026 | 6 Oct 2026 | 1 | 2 | 2 | 1798 |
| 2 | 9 Nov 2025 | 19 Nov 2025 | 2 | 3 | 5 | 1145 |
| 3 | 20 Sep 2026 | 27 Sep 2026 | 5 | 4 | 4 | 596 |
| 4 | 16 Jun 2025 | 2 Jul 2025 | 2 | 1 | 5 | 1145 |
| 5 | 26 Mar 2026 | 31 Mar 2026 | 1 | 3 | 4 | 3596 |
| 6 | 4 Dec 2025 | 10 Dec 2025 | 5 | 4 | 5 | 745 |
| 7 | 8 Jul 2025 | 26 Jul 2025 | 6 | 1 | 4 | 196 |
| 8 | 20 Feb 2025 | 1 Mar 2025 | 3 | 2 | 3 | 59.7 |
| 9 | 9 Dec 2025 | 24 Dec 2025 | 6 | 2 | 2 | 98 |
| 10 | 12 Aug 2026 | 25 Aug 2026 | 2 | 1 | 2 | 458 |
| 11 | 7 Sep 2026 | 12 Sep 2026 | 5 | 4 | 2 | 298 |
| 12 | 2 Mar 2026 | 14 Mar 2026 | 6 | 2 | 3 | 147 |
Showing the first 12 of 120 rows.
Measures: [Total Sales]
Product 6 rows, 4 columns
| ProductID | Product | Category | Price |
|---|---|---|---|
| 1 | Laptop | Hardware | 899 |
| 2 | Monitor | Hardware | 229 |
| 3 | Mouse | Accessories | 19.9 |
| 4 | Keyboard | Accessories | 39.9 |
| 5 | Office suite | Software | 149 |
| 6 | Antivirus | Software | 49 |
Region 4 rows, 2 columns
| RegionID | Region |
|---|---|
| 1 | North |
| 2 | South |
| 3 | West |
| 4 | East |
Date 730 rows, 4 columns
| Date | Year | Month | MonthName |
|---|---|---|---|
| 1 Jan 2025 | 2025 | 1 | Jan |
| 2 Jan 2025 | 2025 | 1 | Jan |
| 3 Jan 2025 | 2025 | 1 | Jan |
| 4 Jan 2025 | 2025 | 1 | Jan |
| 5 Jan 2025 | 2025 | 1 | Jan |
| 6 Jan 2025 | 2025 | 1 | Jan |
| 7 Jan 2025 | 2025 | 1 | Jan |
| 8 Jan 2025 | 2025 | 1 | Jan |
| 9 Jan 2025 | 2025 | 1 | Jan |
| 10 Jan 2025 | 2025 | 1 | Jan |
| 11 Jan 2025 | 2025 | 1 | Jan |
| 12 Jan 2025 | 2025 | 1 | Jan |
Showing the first 12 of 730 rows.
What a relationship does
A 2026 row in the matrix filters the date table to every day of 2026. The relationship carries this filter on into the fact table: what remains are all orders whose order date is one of those days. Only then does the measure calculate. Without a relationship the fact table would stay unfiltered and every row would show total sales.
Active and inactive
Many fact tables have several date columns: order date, ship date, payment date. All belong to the same date table. Power BI only allows one active path between two tables, otherwise it would be unclear which date a filter on 2026 means. The other relationships stay in the model as inactive ones. A measure can switch them on deliberately with USERELATIONSHIP inside CALCULATE (level 5).
Task Someone connected the date table on the ship date. The report should calculate by order date, though. Make the relationship on OrderDate the active one and keep the one on ShipDate as an inactive relationship.
Sales 120 rows, 7 columns
| OrderID | OrderDate | ShipDate | ProductID | RegionID | Quantity | Amount |
|---|---|---|---|---|---|---|
| 1 | 3 Oct 2026 | 6 Oct 2026 | 1 | 2 | 2 | 1798 |
| 2 | 9 Nov 2025 | 19 Nov 2025 | 2 | 3 | 5 | 1145 |
| 3 | 20 Sep 2026 | 27 Sep 2026 | 5 | 4 | 4 | 596 |
| 4 | 16 Jun 2025 | 2 Jul 2025 | 2 | 1 | 5 | 1145 |
| 5 | 26 Mar 2026 | 31 Mar 2026 | 1 | 3 | 4 | 3596 |
| 6 | 4 Dec 2025 | 10 Dec 2025 | 5 | 4 | 5 | 745 |
| 7 | 8 Jul 2025 | 26 Jul 2025 | 6 | 1 | 4 | 196 |
| 8 | 20 Feb 2025 | 1 Mar 2025 | 3 | 2 | 3 | 59.7 |
| 9 | 9 Dec 2025 | 24 Dec 2025 | 6 | 2 | 2 | 98 |
| 10 | 12 Aug 2026 | 25 Aug 2026 | 2 | 1 | 2 | 458 |
| 11 | 7 Sep 2026 | 12 Sep 2026 | 5 | 4 | 2 | 298 |
| 12 | 2 Mar 2026 | 14 Mar 2026 | 6 | 2 | 3 | 147 |
Showing the first 12 of 120 rows.
Measures: [Total Sales]
Product 6 rows, 4 columns
| ProductID | Product | Category | Price |
|---|---|---|---|
| 1 | Laptop | Hardware | 899 |
| 2 | Monitor | Hardware | 229 |
| 3 | Mouse | Accessories | 19.9 |
| 4 | Keyboard | Accessories | 39.9 |
| 5 | Office suite | Software | 149 |
| 6 | Antivirus | Software | 49 |
Region 4 rows, 2 columns
| RegionID | Region |
|---|---|
| 1 | North |
| 2 | South |
| 3 | West |
| 4 | East |
Date 730 rows, 4 columns
| Date | Year | Month | MonthName |
|---|---|---|---|
| 1 Jan 2025 | 2025 | 1 | Jan |
| 2 Jan 2025 | 2025 | 1 | Jan |
| 3 Jan 2025 | 2025 | 1 | Jan |
| 4 Jan 2025 | 2025 | 1 | Jan |
| 5 Jan 2025 | 2025 | 1 | Jan |
| 6 Jan 2025 | 2025 | 1 | Jan |
| 7 Jan 2025 | 2025 | 1 | Jan |
| 8 Jan 2025 | 2025 | 1 | Jan |
| 9 Jan 2025 | 2025 | 1 | Jan |
| 10 Jan 2025 | 2025 | 1 | Jan |
| 11 Jan 2025 | 2025 | 1 | Jan |
| 12 Jan 2025 | 2025 | 1 | Jan |
Showing the first 12 of 730 rows.
This exercise is part of Premium.
Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.
See Premium Already Premium? Log in
The first exercise in this lesson is free.
In real Power BI
- New relationship: Home, Manage relationships, New relationship. The first table and column at the top, the second below.
- Properties: cardinality, cross filter direction and "Make this relationship active". More in the next lesson.
- Edit: double-clicking the line in model view opens the same settings.
- Inactive relationship: shows as a dashed line. To switch the active one, deactivate the old one first, then activate the new one.
Common mistakes
The wrong date is active
If the ship date is active, every time analysis calculates by shipping. Orders from the end of the year then land in the next year. After loading, check which line is solid.
Two date tables instead of one
Loading a separate date table for each date also means two slicers. With one date table and inactive relationships the report stays clear.
Frequently asked questions
Can a relationship use two columns?
No, relationships in Power BI connect exactly one column with one column. If the key needs two columns, combine them into one in Power Query first.
Does the column have to have the same name?
No. Autodetect uses matching names, but you can pick any suitable column. Content and data type have to match.