Monday, March 8, 2021

Manage Relationship in Power BI

Relationships between the tables are necessary to accurately calculate results and display the correct information in your report.


Power BI Desktop makes creating those relationships easy.


Let's create a relationship between four tables imported from an Excel file using Get Data.

The WorldEvents.xlsx file includes Events, Category, Country and Continent tables.

Initially, I loaded only three tables viz. Events, Category and Country to the Power BI Desktop.

As, Power BI attempts to find and create relationship for us, I selected Home > Manage Relationship > Autodetect.

But then it was showing as 'There are no relationships defined yet.'

So again selected Home > Manage Relationship > New.

In the Create Relationship dialog box, in the first table drop down box, i selected the first table Country and selected the column Country ID.

In the second table drop down box, i selected the table Event and selected the column EventCountry ID and clicked OK.

First relationship is done!!

    By default Power BI automatically configures the options Cardinality, Cross filtration and makes this relationship active.

Now, let's do the same for creating second relationship between the table Event and Category by connecting EventCategory ID and Category ID.

Next, I wanted to add the forth table to Power BI desktop and manage its relationship too.

It can be done very easily by selecting recent sources on the Home tab and adding the Continent table from the same excel sheet used before.

As the forth table is imported, it's time to create a join between Country table and Continent table, same by selecting ContinentID from first table and ContinentID from second table.

The relationships for the all the tables are created which will help report generation.

Saving the file with Creating Cultural Connection.pbix name.













No comments:

Post a Comment

Microsoft Power BI

Microsoft Power BI Measures

    Power BI desktop offers a wide range of functionalities to create reports and insights into data easily. But still, there might be some ...