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
OrderIDOrderDateShipDateProductIDRegionIDQuantityAmount
13 Oct 20266 Oct 20261221798
29 Nov 202519 Nov 20252351145
320 Sep 202627 Sep 2026544596
416 Jun 20252 Jul 20252151145
526 Mar 202631 Mar 20261343596
64 Dec 202510 Dec 2025545745
78 Jul 202526 Jul 2025614196
820 Feb 20251 Mar 202532359.7
99 Dec 202524 Dec 202562298
1012 Aug 202625 Aug 2026212458
117 Sep 202612 Sep 2026542298
122 Mar 202614 Mar 2026623147

Showing the first 12 of 120 rows.

Measures: [Total Sales]

Product 6 rows, 4 columns
ProductIDProductCategoryPrice
1LaptopHardware899
2MonitorHardware229
3MouseAccessories19.9
4KeyboardAccessories39.9
5Office suiteSoftware149
6AntivirusSoftware49
Region 4 rows, 2 columns
RegionIDRegion
1North
2South
3West
4East
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

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
OrderIDOrderDateShipDateProductIDRegionIDQuantityAmount
13 Oct 20266 Oct 20261221798
29 Nov 202519 Nov 20252351145
320 Sep 202627 Sep 2026544596
416 Jun 20252 Jul 20252151145
526 Mar 202631 Mar 20261343596
64 Dec 202510 Dec 2025545745
78 Jul 202526 Jul 2025614196
820 Feb 20251 Mar 202532359.7
99 Dec 202524 Dec 202562298
1012 Aug 202625 Aug 2026212458
117 Sep 202612 Sep 2026542298
122 Mar 202614 Mar 2026623147

Showing the first 12 of 120 rows.

Measures: [Total Sales]

Product 6 rows, 4 columns
ProductIDProductCategoryPrice
1LaptopHardware899
2MonitorHardware229
3MouseAccessories19.9
4KeyboardAccessories39.9
5Office suiteSoftware149
6AntivirusSoftware49
Region 4 rows, 2 columns
RegionIDRegion
1North
2South
3West
4East
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

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

  1. New relationship: Home, Manage relationships, New relationship. The first table and column at the top, the second below.
  2. Properties: cardinality, cross filter direction and "Make this relationship active". More in the next lesson.
  3. Edit: double-clicking the line in model view opens the same settings.
  4. 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.

Learn this next: cardinality and cross filter direction

Which side is the one, and in which direction does the filter flow?

Cardinality and cross filter direction

Write to us

Choose language

Select your preferred language