Power BI BasicsCore· 35 min read

The Data Model: Relationships Between Tables

When data lives in two tables, a relationship links them — so a sale knows which customer it belongs to.

What you will learn

  • Understand why data is split into tables
  • See a relationship on the Model view
  • Match a key column in both tables

Why more than one table?

Good data is usually split into separate tables to avoid repeating yourself. Instead of typing a customer name on every single sale, you keep customers in one table and sales in another, and link them. This is called a data model.

Picture two tables:

  • A Sales table: each row is one sale, with a CustomerID, a product and an amount.
  • A Customers table: each row is one customer, with a CustomerID, a name and a city.

The shared key column

Both tables share a column: CustomerID. That shared column is the key that lets Power BI connect them. A relationship says: “the CustomerID in Sales matches the CustomerID in Customers.”

Sales tablelinks byCustomers table
CustomerID = 7CustomerID = 7 → “Asha, Delhi”
CustomerID = 7(same customer)
CustomerID = 12CustomerID = 12 → “Ravi, Pune”

Creating the relationship

On the far-left of Power BI Desktop there are three small icons: Report, Data, and Model. Click the Model view (it looks like little connected boxes). You will see each table as a box listing its columns. To link them:

  1. Find CustomerID in the Sales box.
  2. Drag it onto CustomerID in the Customers box.
  3. A line appears between the two tables — that line is the relationship.

Power BI is smart: when it spots two columns with the same name, it often creates this line for you automatically.

A one-to-many relationship: the 1 side is Customers, the many side is Sales
Customers (1) ────────< (many) Sales

One customer  ->  can have many sales
Many sales    ->  each belong to one customer

Note: Output: The little 1 sits next to Customers and the * (many) sits next to Sales, showing one customer can appear in many sales rows. Now a chart can show “total Amount by customer City”, even though City lives in one table and Amount lives in the other — the relationship carries the link across.

Tip: This one-to-many shape is by far the most common: one customer → many sales, one product → many orders. The “one” side is the lookup list; the “many” side is the table of events.

Watch out: A relationship needs matching values in both key columns. If Sales has CustomerID 99 but Customers has no row for 99, those sales will not match a customer and may show as blank in your visuals.

Q. What lets Power BI connect a Sales table to a Customers table?

Answer: A relationship links two tables using a shared key column (e.g. CustomerID). It lets visuals combine fields from both tables correctly.

✍️ Practice

  1. Open Model view and identify the shared key column between two of your tables.
  2. Drag one key column onto the matching column in the other table to create a relationship.

🏠 Homework

  1. With a Sales table and a Customers table, create a one-to-many relationship on CustomerID and describe which side is the “one” and which is the “many”.
Want to learn this with a mentor?

CodingClave runs guided, project-based training (28-day, 45-day & 6-month batches).

Explore Training →