Sub topic 6
The Bridge Table Pattern
This chapter assumes you can read Power BI Desktop's model view, know fact and dimension tables, understand one-to-many relationships, and can write basic DAX with SUM and CALCULATE. It covers what a bridge table is and why it works. The next chapters cover how to build and wire one.
The problem a bridge solves
Suppose a bank reports Transactions by Customers. Each transaction belongs to one account. An account can have several owners, and a customer can own several accounts. So Accounts and Customers have a true many-to-many relationship.
A Power BI relationship that is one-to-many needs one side with unique values. Neither the account-to-customer pairing nor the customer-to-account pairing is unique on either side, so you cannot join the two dimensions directly with a classic one-to-many relationship.
What a bridge table is
A bridge table (also called a junction or factless table) lists each valid pairing of two keys, one row per pair. It holds no amounts. In this model, AccountBridge has two columns: AccountID and CustomerID.
The many-to-many relationship is replaced by two one-to-many relationships:
Accounts[AccountID](one) toAccountBridge[AccountID](many)Customers[CustomerID](one) toAccountBridge[CustomerID](many)
Each dimension is now on the "one" side, and the bridge sits on the "many" side of both.
How filters travel
Filters in Power BI move from the "one" side to the "many" side by default. Following the diagram:
- A slicer on
CustomersfiltersAccountBridgedown to that customer's rows. - The filtered bridge should then filter
Accounts. Accountsthen filtersTransactions.
Step 2 goes from the "many" side (bridge) to the "one" side (Accounts). That is against the default direction, so it does not happen on its own. Without a change, selecting a customer leaves Transactions unfiltered, and every customer shows the same total.
You can fix this in two ways. One is to set that relationship's cross-filter direction to Both in the model. The other is to leave the model alone and enable the reverse flow inside a measure, using CROSSFILTER or TREATAS. Later chapters compare these options.
Why unique keys matter
Each dimension must have unique keys on its "one" side, and the bridge should contain each pair only once. Duplicate pairs in the bridge do not break the relationships, but they make the model harder to reason about and can cause confusion when you check totals. Start with a source that lists pairs, then remove repeated rows.
Bridge versus native many-to-many
Power BI can also create a many-to-many relationship directly between two columns, with no extra table. The bridge pattern instead makes the pairing visible as a table you can inspect, filter, and extend. For example, you can add a weight column to the bridge to split a value between owners. This is the main reason to pick it, and a later chapter compares the two approaches in more detail.
Check your understanding
Exercise
A model has Products, Categories, and Sales. A product can belong to several categories, and a category contains several products. Which tables do you relate with a bridge, what columns does the bridge hold, and which side of each relationship is the "one" side?
Show answer
The bridge relates Products and Categories. It holds ProductID and CategoryID, one row per valid pair. Products is the "one" side of the relationship on ProductID, and Categories is the "one" side on CategoryID. The bridge is the "many" side of both. Sales relates to Products in the usual one-to-many way.
Exercise
You select one customer in a slicer, but the total on the report equals the grand total. All relationships between the dimensions and the bridge are one-to-many with single direction filtering. What is the likely cause?
Show answer
The filter reaches AccountBridge from Customers, but cannot move from the bridge to Accounts, because that is the many-to-one direction. Setting that relationship to Both, or using CROSSFILTER or TREATAS in the measure, lets the filter continue to Transactions.