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
Twelve
Regular Visitor

Filtering a table based on another table's slicer value when both tables are related

Hello,

I have two tables and a slicer.

 

Table1 is the following:

ValuesExtraCol1ExtraCol2
Value1ExtraCell13
Value2ExtraCell22
Value3ExtraCell14

 

and Table2 is the following:

IDColumnAColumnB
1Value1Value1
2Value2Value1
3Value1Value2
4Value3Value3

and they are related in both directions with Values <> ColumnA. I have a slicer that allows me to filter Table1 based on the column Values and through that it filters the IDs that I want in Table2 (based on ColumnA). If I choose 'Value1' on the slicer, I'll get the IDs '1' and '3'.

 

All of this is fine in all of my visualizations except one. In one of my visualizations, I will want to see the IDs that correspond to the values chosen with the slicer, but through ColumnB ONLY. That is, if I choose 'Value1' on the slicer, I want to get the IDs '1' and '2' only.

 

Thank you for your help!

 

P.S. I tried to attach a .pbix with the tables written above but it doesn't seem to work.

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

Hi @Twelve ,

 

Create an inactive relationship and create a measure as below.

Measure = CALCULATE(MAX(TableB[ID]),USERELATIONSHIP(TableA[Values],TableB[ColumnB]))

1.PNG

2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @Twelve ,

 

Create an inactive relationship and create a measure as below.

Measure = CALCULATE(MAX(TableB[ID]),USERELATIONSHIP(TableA[Values],TableB[ColumnB]))

1.PNG

2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@Twelve , if they are joined 1-M fromTable1  to Table2 where Values is unique in Table 1, then you need two joins with ColumnA and Column B

One will be inactive and you can activate the inactive one using Userelationship in Measure https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

Thank you for your answer @amitchandak 

I can see how this would work for calculated measures and numeric, but how can I use USERELATIONSHIP to filter my Table2 as show above?

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.