![]() |
Relationships are established between tables to connect them via an attribute and the tables can be considered as one whole table for further process. However, in many cases, Power BI creates relationships on its own. In this article, we will learn more about creating table relationships in Power BI Desktop. What are Table Relationships?A relationship described between two or more tables via a common attribute is termed a table relationship. It is very crucial as it enables users to access data from two separate tables with ease. Types of Table RelationshipsThere are four types of table relationships
Creating Table Relationships in Power BI DesktopIn order to create table relationship in Power BI Desktop, follow the following steps: Create a table by clicking on “Enter data”. ![]() Creating Table Relationships in Power BI Desktop Insert the desired records in the table for instance make table student with attributes Student ID, Name, Class, Total Marks. ![]() Table Relationships in Power BI Desktop After inserting the records, click on load to save the table. Create another table for instance Studentinfo with attributes Student ID, Name, Phone No., Address. Insert records in Studentinfo. ![]() Table Relationships in Power BI Desktop ![]() Table Relationships in Power BI Desktop Click on Manage relationships to establish relationship between tables. ![]() Table Relationships in Power BI Desktop Manage relationships dialog box appears which shows relationship between table. Create Power BI relationships using AutoDetectAfter clicking on manage relationships, dialog box shown below pops on the screen which tells there are no relationships defined yet. ![]() Table Relationships in Power BI Desktop Click on Autodetect and the relationships that have been detected automatically appears. ![]() Table Relationships in Power BI Desktop ![]() Table Relationships in Power BI Desktop Create Power BI relationships manuallyClick on New in Manage relationships to establish new relation. Select Table name and the attribute of both the table to establish relationship. For instance, Select Name from both Student and Studentinfo table and establish the relationship. ![]() Table Relationships in Power BI Desktop The relationship established will be shown in Manage relationships. ![]() Table Relationships in Power BI Desktop Click on “Model view” ![]() Table Relationships in Power BI Desktop The relationship established will be shown in Model view. The relationship established between Student and Studentinfo via Student ID is shown below. ![]() Table Relationships in Power BI Desktop The relationship established between Student and Studentinfo via Name is shown below. ![]() Table Relationships in Power BI Desktop Cardinality
![]() Table Relationships in Power BI Desktop
Cross filter directionCross filter considers the attributes/columns from both the tables that join them together and allows the user to tell the direction of filtering allowed.
Identifying Key Fields for RelationshipsA table relationship works by matching key fields.
![]() Table Relationships in Power BI Desktop
Configuring and Establishing One-to-Many RelationshipsClick on ‘Enter data’ and create a table Streams which represents Science and Commerce stream . ![]() Table Relationships in Power BI Desktop The table Stream will look like the table given below. ![]() Table Relationships in Power BI Desktop Click on ‘Manage relationships’ to establish a relationship between given tables. Then establish a relationship between Stream and Student where class acts as a common entity. The relationship established is one to many as shown below. ![]() Table Relationships in Power BI Desktop The relationship established between Stream and Student is one to many relationship (1:*). ![]() Table Relationships in Power BI Desktop How to make relationship active?User can make relationship Active in two ways: ![]() Table Relationships in Power BI Desktop
In Manage relationships, one can make any relationship “Active” by clicking on checkbox under Active. ![]() Table Relationships in Power BI Desktop Creating table relationships in Power BI Desktop is a crucial step in building a robust data model that allows for effective analysis and visualization. |
Reffered: https://www.geeksforgeeks.org
Geeks Premier League |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 16 |