Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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.
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?
Solved! Go to Solution.
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 )
)
If you don't use REMOVEFILTERS, with the connection from B > the table, it doesn't let the values selected in A show up.
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.
Not sure this is what you are looking for but I think it might be.
I have the two disconnected tables with the GroupNames.
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.
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?
User | Count |
---|---|
64 | |
59 | |
47 | |
32 | |
31 |
User | Count |
---|---|
84 | |
73 | |
52 | |
50 | |
44 |