Learning how to create relationships in Power BI is a fundamental step in building accurate and efficient data models. Relationships connect tables, allowing data from different sources to work together seamlessly. Whether analyzing sales performance, tracking customer behavior, or linking product information, establishing relationships correctly ensures the reliability of calculations, filters, and visualizations.
This guide explains the importance of relationships in Power BI, the steps to create them, and the options available when managing relationship settings.
What are Relationships Between Tables in Power BI?
Power BI relationships define how data in one table is linked to data in another. For example, a CustomerID field in a Orders table can be connected to the same CustomerID in a Customers table. Once this relationship is in place, visuals and DAX formulas can pull and aggregate data across both tables accurately.
Tip: To create relationships in Power BI, at least one column in each table must contain matching values and use the same data type. These relationships between tables form the foundation of the data model.
When Should Tables Be Linked in Power BI
Creating relationships is essential when:
- Multiple tables exist in the data model.
- Reports or calculations need data from more than one table.
- Tables are part of a normalized (star schema) structure with fact and dimension tables.
Without relationships, Power BI treats each table in isolation, preventing meaningful analysis across related datasets.
How to Create Relationships Between Tables in Power BI
In this section we will see how to create a relationship between Order, OrderDetails and Customer Tables to create a data model.
For this example, we will load OrderDetails, Orders and Customers Tables. The Structure of these tables are shown below:
Note: When tables/data is loaded in Power BI, it automatically creates relationships between them based on the matching fields. It is ok to turnoff this feature so that you can create relationships manually. To turnoff this feature, navigate to File and select Options and Settings and then select Options. Under Options, you will see two types of settings: Global and Current File. Navigate to Current File and go to Data Load, uncheck “Autodetect new relationships after data is loaded” as shown in the figure below:
Steps:
- Load the XLS OrderDetails, Orders and Customers in Power BI desktop. To load data in Power BI, Get Data option or Query Editor can be used. Once the tables are loaded they will appear in the Model view.
- To create a relationship between OrderDetails and Orders table, from the ribbon under Home, select Manage relationships.
- In the “Manage relationships” box, click on New Relationship. Select the Orders table first and then the OrderDetails table. Make sure that OrderID is selected in both the tables, as this field is used for creating the relationship. Based on the data in the tables, it will display the Cardinality as One to many and Cross-filter direction as Single.
- Click on Save
- Similary, create a relationship between Customers and Orders table. Select Customers table first and then the Orders table. Select CustomerID field in both the tables. Based on the data in the tables, it will display the Cardinality as One to many and Cross-filter direction as Single.
The above steps will create a data model as shown in the figure below:
Best Practice. Always select the lookup table (the table with unique values) first when creating relationships in Power BI. This ensures that Power BI correctly identifies the One-to-Many relationship and maintains the proper filter flow across the data model. Following this approach helps prevent relationship errors and supports a clean, scalable model design.
Understanding Cross-Filter direction in Power BI
When creating a relationship between two tables (for example, Orders → OrderDetails), it is necessary to define the cross filter direction, which controls how filters flow between the tables.
Direction | Description | When to Use |
---|---|---|
Single | Filters flow from one table to the other (typically from the lookup table to the fact table). | Most common for One-to-Many relationships. |
Both | Filters flow in both directions between the tables. | Used when fields from both tables need to filter each other, such as in Many-to-Many relationships or complex reporting scenarios. |
- In a One-to-Many relationship (like Orders → OrderDetails), Single direction is usually sufficient and preferred.
- Bi-Directional (Both) filtering should be used only when necessary, because it increases model complexity and can cause ambiguity in relationships.
Creating relationships in Power BI is essential for connecting data across multiple tables and building accurate reports. By understanding filter direction, and table roles, a strong foundation for reliable data models can be established.
Expand Your Power BI Skills
Interested in mastering Power BI beyond the basics?
Explore the comprehensive guide Mastering Power BI, Second Edition — packed with advanced data modeling, DAX techniques, and real-world reporting strategies.
If you’re looking for hands-on, instructor-led Power BI training, contact us today to learn more about upcoming courses and private training options.
Chandraish Sinha is the founder and President of Ohio Computer Academy, a company dedicated to providing IT education. An enthusiastic IT trainer, Chandraish embodies his company’s motto: Inspire, Educate & Evolve.
He has 20+ years of experience in Information Technology. He is an accomplished author and has published 11 books covering Business Intelligence related topics such as, Tableau, Power BI and Qlik. Checkout his Amazon Author profile.
His latest book Excel Basics to Advanced covers all the aspects of MS Excel and provides exercises for self-learning.
Similarly, his recent book, Dashboarding with Tableau, covers all the features in Tableau and includes exercises for self-learning.
He has implemented IT solutions in various domains viz. Pharmaceutical, Healthcare, Telecom, Financial and Retail.
He blogs regularly on various IT topics. Check them out in the links given below: