Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply

Two joins between 2 tables

Hello I am new to Power BI , Wanted to ask can I have two relation between two table on different columns 
For Example

1st Relation --TableA(Emp ID)-TableB(Emp ID)

2nd Relation --TableA(Service)-TableB(Service)

Ist this valid in Power BI ?

 

3 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@prajaktakeni11 Yes, but one relationships will be inactive. You can use USERELATIONSHIP to select the relationship you want to use in a calculation in DAX.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

dshmulenson
New Member

Hi

yes it is possible. but you probaly have to active one of the relationships

View solution in original post

Anonymous
Not applicable

Hi @prajaktakeni11 ,

First of all, many thanks to @dshmulenson and @Greg_Deckler  for your very quick and effective replies, and I will give some additions below:

To answer your question: Yes, you can indeed have multiple relationships between two tables in Power BI, including on different columns as you've described. You can have a relationship between 'TableA(Emp ID)' and 'TableB(Emp ID)'as well as between 'TableA(Service)' and 'TableB(Service)'. This is a valid scenario in Power BI.

 

However, it's important to note that while you can define multiple relationships between two tables, only one of these relationships can be active at any given time. The active relationship is the one that Power BI uses for filter propagation in your reports by default. The additional relationships will be set as inactive but can be utilized in your DAX calculations using the 'USERELATIONSHIP' function to temporarily treat an inactive relationship as active.

For more detailed guidance on creating and managing relationships in Power BI, including setting relationships as active or inactive, I recommend checking out the following documentation: Create and manage relationships in Power BI Desktop - Power BI | Microsoft Learn

 

And for utilizing inactive relationships in your DAX calculations: USERELATIONSHIP function (DAX) - DAX | Microsoft Learn

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
josef78
Memorable Member
Memorable Member

Depends on what you want...

If you need two relations between two tables, it is possible (only one relation can be activelly used).

If you need single relation on two pair of columns beween two tables, it is not possible directly, you must make merge column first.

Anonymous
Not applicable

Hi @prajaktakeni11 ,

First of all, many thanks to @dshmulenson and @Greg_Deckler  for your very quick and effective replies, and I will give some additions below:

To answer your question: Yes, you can indeed have multiple relationships between two tables in Power BI, including on different columns as you've described. You can have a relationship between 'TableA(Emp ID)' and 'TableB(Emp ID)'as well as between 'TableA(Service)' and 'TableB(Service)'. This is a valid scenario in Power BI.

 

However, it's important to note that while you can define multiple relationships between two tables, only one of these relationships can be active at any given time. The active relationship is the one that Power BI uses for filter propagation in your reports by default. The additional relationships will be set as inactive but can be utilized in your DAX calculations using the 'USERELATIONSHIP' function to temporarily treat an inactive relationship as active.

For more detailed guidance on creating and managing relationships in Power BI, including setting relationships as active or inactive, I recommend checking out the following documentation: Create and manage relationships in Power BI Desktop - Power BI | Microsoft Learn

 

And for utilizing inactive relationships in your DAX calculations: USERELATIONSHIP function (DAX) - DAX | Microsoft Learn

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

dshmulenson
New Member

Hi

yes it is possible. but you probaly have to active one of the relationships

Greg_Deckler
Super User
Super User

@prajaktakeni11 Yes, but one relationships will be inactive. You can use USERELATIONSHIP to select the relationship you want to use in a calculation in DAX.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.