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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
klehar
Helper V
Helper V

Userelationship() dax to slice data

Hi,

 

I have created a link between my dimension and fact that but since the model is very complex and interjoined with a lot of other tables, it gives the following error: 

 

"You can't create a direct active relationship between Table1 and Table2 becuase that would introduce ambiguity between other tables.

klehar_0-1619445115493.png

 

What can i do to make my dimesion table filter my fact that with an inactive relationship?

 

One thing that comes to my mind is the userelatiosnhip() dax but not sure how I would use this.

There could be other solutions as well.  Has anyone encountered this scenario?

 

1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @klehar 

DAX allows you to override the active relationship and use the inactive relationship in your formulas instead. To do this, you must use the DAX function USERELATIONSHIP .

(1)Create an inactive relationship between two tables .

(2)Create a measure like :Measure = CALCULATE(SUM('Table A'[ID]),USERELATIONSHIP('Table A'[Column 1],'Table B'[Column 2]))

(3)Put the measure in your visual , the Inactive relationships will be activated .

 

Best Regards

Community Support Team _ Ailsa Tao

 

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

1 REPLY 1
v-yetao1-msft
Community Support
Community Support

Hi @klehar 

DAX allows you to override the active relationship and use the inactive relationship in your formulas instead. To do this, you must use the DAX function USERELATIONSHIP .

(1)Create an inactive relationship between two tables .

(2)Create a measure like :Measure = CALCULATE(SUM('Table A'[ID]),USERELATIONSHIP('Table A'[Column 1],'Table B'[Column 2]))

(3)Put the measure in your visual , the Inactive relationships will be activated .

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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