Open In App

Creating Table Relationships and Data Models in Power BI

Last Updated : 02 May, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Power BI Data Model is the collection of tables and relationships between them that are used to create reports and visualizations. It involves defining relationships between tables and creating calculated columns and measures. In this article, we will learn about data models in Power BI.

Model Relationships in Power BI

In Power BI model relationships define how the tables are linked. In model relationships you can create effective and insightful data visualization for easy understanding. There are different types of relationships:-

  • One-to-One Relationships: Each row in the first table is connected to one and only one row in the second table.
  • Many-to-One Relationships: Many rows in the first table are connected to one row in the second table.
  • One-to-Many Relationships: Each row in the first table is connected to one or many rows in the second table.
  • Many-to-Many Relationships: Each row in the first table can be connected to many rows in the second table. They are a type of relationship that requires an intermediate table that links the two main tables.

Always use unique and descriptive column names to avoid confusion in creating relationships and use a hierarchy of tables to manage relationships between multiple tables.

How to Create Relationship in Power BI?

Creating relationships in Power BI defines how tables are connected helping you to analyze and visualize data from multiple sources seamlessly. Power BI provides two methods for creating relationships: Autodetect and Manual.

  • Autodetect method automatically identifies and creates relationships based on fields with matching names in different tables making the process quick and easy.
  • If you prefer more control the Manual method allows you to specify which tables and fields to connect and define the relationship type such as One-to-One, One-to-Many, Many-to-One or Many-to-Many.

Below are some methods we can do in Power BI for Data Models Relationships.

1. Creating Relationship with Autodetect  

By using auto-detect feature while creating a relationship users can establish relationships between tables based on field name and interconnected to data model for report and analyze. Steps-by-Steps guidelines are:

Step 1: Load your Data using the “Home” tab and select “Get Data”.

Get Data in Power BI
Get Data

Step 2: On the modeling view, Go to the “Manage Relationship”.

Manage Relationship in Power BI
Manage Relationship

Step 3: Select “Autodetect” option and then select the "OK" option

Autodetect Relationship in Power BI
Autodetect Relationship

2. Creating a Relationship Manually

In Power BI users can create table relationships manually. Cardinality and cross-filter direction are automatically set during creation but users can edit them as required. By manually creating relationships in Power BI users have greater control and are able to customize the relationships between two tables that are interconnected to each other. Steps-by-Steps guidelines are:

Step-1:  Load your Data using the “Home” tab and select “Get Data”.

Get Data in Power BI
Get Data

Step-2: On the modeling view, go to the “Manage Relationship”.

Manage Relationship in Power BI
Manage Relationship

Step-3: Select “New” option and then select the first table and then select the column you want to use in a relationship then select the second table and then select the column you want to use in a relationship and select the “OK” option.

Manual Relationship in Power BI
Manual Relationship

3. Edit Relationships in Power BI

Table relationships in Power BI can be edited using different methods:

Diagram View

Open the "Diagram View". Drag and drop fields between related tables to establish or edit relationships and adjust cardinality and cross-filter direction as needed.

Diagram View
Diagram View

Manage Relationships

To manage the relationship go to the Home tab and select "Manage Relationships". Select the existing relationship to edit or add a new one and specify tables, related fields and cardinality.

Manage Relationship
Manage Relationship

Data View

Open "Data View." Click on the relationship icon next to the field to edit relationships and then modify related fields and cardinality as required.

Screenshot-2023-12-20-200547
Data View in Power Bi

4. Configure More Options in Relationships

Once your tables are interconnected with each other it is very important to edit relationships in power bi. Editing relationship adjust the properties of an existing relationship or modifying the relationships type. Here we'll examine two aspects:

Cardinality

In Power BI cardinality plays an important role in defining the nature of relationships between tables within a data model. It specifies how the rows in the first table connected to the rows in the second table. When creating and editing relationships in power bi choosing an appropriate cardinality is very important for data analysis and reporting. By understanding and setting cardinality correctly users can navigate easily across related tables.

Cross-filter direction

In power bi every power bi model relationship is called cross-filter direction. Cross-filter directions dependent on cardinality type like Single and Both cross-filter direction type will be applied as One-to-Many or many-to-One cardinality type Both cross-filter type will applied as One-to-One cardinality type and Single (Table1 to Table2), Single (Table2 to Table1) Both cross-filter type will applied as Many-to-Many cardinality type.

Building Data Models in Power BI

By following thee below steps, we can build data models in Power BI:

1. Import Data: Connect to data sources and import relevant datasets into Power BI.

Get Data
Get Data

2. Transform Data: Use Power Query Editor to clean, transform, and shape data as needed.

Transform data in Power BI
Transform data

3. Create Relationships: Define relationships between tables based on common fields.

Manage Relationship
Manage Relationship

4. Build Measures: Use DAX (Data Analysis Expressions) to create custom calculations and measures.

New Measure in Power BI
New Measure in Power BI

5. Building Visualizations

To build visualization in Power BI follow these step-

1. Select Visualizations: Choose the appropriate visualizations like bar chart, line chart, table for the type of insights needed.

Select Visualization

2. Drag and Drop Fields: Drag and drop fields from the data model onto the appropriate areas of the chosen visualization.

Drag and drop fields

3. Format Visual Elements: Customize visual elements such as colors, fonts and titles to enhance clarity and aesthetics.

Visual elements

4. Apply Filters: Utilize filters to focus on specific subsets of data within the visualizations.

Filters in Power BI

How to Make Relationship Active

By following steps for making the relationship active are-

1. Open Power BI Desktop: Launch Power BI Desktop and open your Power BI project.

Get Data
Get Data

2. Navigate to "Relationships" View: Go to the "Model" view by clicking on the "Model" icon on the left side of the screen.

Relationship VIew

3. Identify the Relationship: Locate the relationship you want to activate between two tables.

Autodetect Relationship
Autodetect Relationship

4. Edit Relationship: Right-click on the relationship line and choose "Edit Relationship" from the context menu.

Create Relationship
Create Relationship

5. Configure Relationship Options: In the "Edit Relationship" dialog, ensure that the "Active" option is checked.

Active Relationship in Power BI
Active Relationship in Power BI

Overall in Power BI while creating a relationships and data model between tables you can easily understand reports and visuals.


Next Article

Similar Reads