Forum Discussion
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:
| Values | ExtraCol1 | ExtraCol2 |
| Value1 | ExtraCell1 | 3 |
| Value2 | ExtraCell2 | 2 |
| Value3 | ExtraCell1 | 4 |
and Table2 is the following:
| ID | ColumnA | ColumnB |
| 1 | Value1 | Value1 |
| 2 | Value2 | Value1 |
| 3 | Value1 | Value2 |
| 4 | Value3 | Value3 |
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.
- Anonymous4 years ago
Hi Anonymous ,
Create an inactive relationship and create a measure as below.
Measure = CALCULATE(MAX(TableB[ID]),USERELATIONSHIP(TableA[Values],TableB[ColumnB]))Best Regards,
Jay
3 Replies
- amitchandakSuper User
Anonymous , 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-power-bi
- AnonymousNot applicable
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?
- AnonymousNot applicable
Hi Anonymous ,
Create an inactive relationship and create a measure as below.
Measure = CALCULATE(MAX(TableB[ID]),USERELATIONSHIP(TableA[Values],TableB[ColumnB]))Best Regards,
Jay