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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Help with USERELATIONSHIP on 2 inactive relationships

Can someone clarify my thinking on how USERELATIONSHIP will handle this scenario...

 

Looking at the image below, I have 4 tables (part of a much more complex model), linked with many relationships for different use-cases. I need to do some formulas which require me to go from the Employee table, through the Job Validation Details table on to the KOP Source table to get the right results for my measure. 

 

As I have 2 inactive realtionships either side of the Job Validation table, my thinking is that if I do 

CALCULATE(my formula,USERELATIONSHIP(Employees[Employee Number],'Job Validation Details'[Employee Number])) it will then force the relationship between Job Validation Details and KOP Source to also become active - is that correct? If not, how do I force both relationships to be active?
 
USERELATIONSHIP.PNG
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous,

 

That is correct USERRELATIONSHIP only enables the indicated relationship for the duration of the calculation, so if you are making for example a count function when you add the USERRELATIONSHIP between employees table and job validation you will get the number of employes that are related in both tables.

 

Check the links below with further insights:

 

https://docs.microsoft.com/en-us/dax/userelationship-function-dax

https://www.sqlbi.com/blog/marco/2013/10/01/using-userelationship-function-in-measures-and-calculated-columns-dax-powerpivot-ssas/

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous,

 

That is correct USERRELATIONSHIP only enables the indicated relationship for the duration of the calculation, so if you are making for example a count function when you add the USERRELATIONSHIP between employees table and job validation you will get the number of employes that are related in both tables.

 

Check the links below with further insights:

 

https://docs.microsoft.com/en-us/dax/userelationship-function-dax

https://www.sqlbi.com/blog/marco/2013/10/01/using-userelationship-function-in-measures-and-calculated-columns-dax-powerpivot-ssas/

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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