Menu

Creating Relationships Between Tables

Creating Relationships Between Tables

What Is a Relationship?

A relationship connects tables through columns that contain corresponding values.

For example, a Sales table may contain a ProductID column, while a Products table contains the same identifier along with product descriptions.

A relationship allows Power BI to use product information when analyzing sales transactions.

Example of Related Tables

Sales Table

SaleID

ProductID

Quantity

10011012
10021023
10031011

Products Table

ProductID

ProductName

101Laptop
102Monitor

If these tables are connected through ProductID, you can create a report showing total quantity sold by product name.

Power BI uses the relationship to associate the transaction records with the appropriate product descriptions.

How to Create a Relationship

You can create relationships manually in Power BI Desktop.

  1. Open your report in Power BI Desktop.
  2. Select Model View.
  3. Locate the tables you want to connect.
  4. Drag the matching column from one table to the corresponding column in the other table, or use Manage Relationships.
  5. Review the relationship settings.
  6. Confirm that the selected columns and relationship configuration are correct.

Power BI may also detect and create relationships automatically. However, you should always review automatically detected relationships before relying on them in reports.

Understanding Relationship Columns

The columns used to connect tables should contain compatible values and data types.

In a typical product relationship, Products[ProductID] contains unique product identifiers, while Sales[ProductID] may contain the same identifier multiple times because a product can appear in many transactions.

The uniqueness of the identifier on the dimension side is especially important for a standard one-to-many relationship.


Power BI Tutorial

VA

Vishalini A



Learn via Video Course

Microsoft Power BI Logo

Microsoft Power BI

3 hrs



Get in Touch For Details