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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply

two slicers with same values to show values on one chart

Hello commnity, 

 

I am working on a report that has two slicers to filter a scatter plot. SlicerA's single selected value is a direct comparison to many values selected from SlicerB.

 

The issue is I cannot have SlicerA's value and SlicerB's values to both show on the scatter plot without manually selecting the same value from SlicerA on SlicerB. 

 

  • SlicerA and SlicerB both have same values and no relationship, but SlicerA only allows single selection whereas SlicerB can have Multiple selections.

 

 I tried so many ways to resolve this, but they dont work. One of them is that I tested below measure, but it does not show slicerA's value "Ma" on the chart if I dont select the same value on slicerB. I disconnect the interection between slicerB and the chart, it does not work either. 

 

 

measure = 
VAR tgtSel =
    SELECTEDVALUE ( A[Target] ) --to store selected value on SlicerA
VAR peerSel = 
    VALUES(B[CompareGroup]) --to store many values selected on SlicerB
VAR tab = 
    --to have a filter that contains both slicerA and slicerB 's values
    FILTER ('table', 
            'table'[GroupNames] IN  peerSel ||
            'table'[GroupNames] = tgtSel  
            )
RETURN
    CALCULATE ( SUM ( 'table'[amount] ), tab )

 

 

 

I dont want to turn off the relationship between slicers and the table because it's not good for future use of the data model. Is there a way to have both slicers' values to show on the scatter plot simultaneously without selecting on SlicerB for the one that was selected on SlicerA?

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Yes, like this.

Measure = 
VAR _TgtSel = 
    { CALCULATE(
        SELECTEDVALUE ( A[Target] ),
        REMOVEFILTERS ( B ) )
    }
VAR _PeerSel =
    VALUES ( B[CompareGroup] )
VAR _List =
    UNION ( _TgtSel, _PeerSel )
RETURN
    CALCULATE (
        [Total Amount],
        KEEPFILTERS ( TREATAS ( _List, 'Table'[GroupNames] ) ),
        REMOVEFILTERS ( B )
    )

View solution in original post

6 REPLIES 6
jdbuchanan71
Super User
Super User

If you don't use REMOVEFILTERS, with the connection from B > the table, it doesn't let the values selected in A show up.

jdbuchanan71
Super User
Super User

Yes, like this.

Measure = 
VAR _TgtSel = 
    { CALCULATE(
        SELECTEDVALUE ( A[Target] ),
        REMOVEFILTERS ( B ) )
    }
VAR _PeerSel =
    VALUES ( B[CompareGroup] )
VAR _List =
    UNION ( _TgtSel, _PeerSel )
RETURN
    CALCULATE (
        [Total Amount],
        KEEPFILTERS ( TREATAS ( _List, 'Table'[GroupNames] ) ),
        REMOVEFILTERS ( B )
    )

Thank you!! You are **bleep** good at this. It took me so many days and not know removefilters()

This solution perfectly fits what I need. Could you please explain why removefilters() has to be added for this to work? I just want to understand it, so I can apply this to other issue. 

jdbuchanan71
Super User
Super User

@learninPBI5Hard 

Not sure this is what you are looking for but I think it might be.
I have the two disconnected tables with the GroupNames.

jdbuchanan71_2-1691899757684.png

And the measure to read the selections and apply them to the data:

1st, just a measure to total the amount.

 

Total Amount = SUM ( 'Table'[Amount] )

 

The, the measure to read the selections and do the final calculation.

 

Measure = 
VAR _TgtSel =
    { SELECTEDVALUE ( A[Target] ) }
VAR _PeerSel =
    VALUES ( B[CompareGroup] )
VAR _List =
    UNION ( _TgtSel, _PeerSel )
RETURN
    CALCULATE (
        [Total Amount],
        KEEPFILTERS ( TREATAS ( _List, 'Table'[GroupNames] ) )
    )

 

The {} around the SELECTEDVALUE in _TgtSel converts it to a table so it can be used in the UNION.

jdbuchanan71_3-1691899791230.png

I have attached my sample file for you to look at.

 

 

Is there a way to do this when there is relationship between b and the table? 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors