Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    4 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

    • Anonymous's avatar
      Anonymous
      Not 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?

  • Anonymous's avatar
    Anonymous
    Not 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