Forum Discussion
Sha
Helper II
6 years agoHow to get common data from selected value in slicer
I have one table that contains business unit, client, sales. I am trying to figure out if my selected business unit (slicer) shares the same client with other business units and get total of sales ...
- 6 years ago
Hi Sha ,
First of all, we can create a separate table to show the data, then we can use a measure in visual filter to filter it:
TableToCompare = 'Table'HasSameClient = IF ( AND ( SELECTEDVALUE ( 'TableToCompare'[Client] ) IN DISTINCT ( 'Table'[Client] ), NOT SELECTEDVALUE ( TableToCompare[Bus unit] ) IN FILTERS ( 'Table'[Bus unit] ) ), 1, -1 )If it doesn't meet your requirement, Please show the exact expected result based on the Tables that we have shared.
Best regards, - 6 years ago
Hi Sha ,
We can use the variable to optimise the code, if you have any other questions, please kindly ask here and we will try to resolve it.
# of Bus Units = VAR SelectedBus = SELECTEDVALUE ( 'Table'[Bus unit] ) RETURN CALCULATE ( DISTINCTCOUNT ( 'TableToCompare'[Bus unit] ), 'TableToCompare'[Bus unit] <> SelectedBus )
Best regards,
v-lid-msft
Community Support
6 years agoHi Sha ,
We can use the variable to optimise the code, if you have any other questions, please kindly ask here and we will try to resolve it.
# of Bus Units =
VAR SelectedBus =
SELECTEDVALUE ( 'Table'[Bus unit] )
RETURN
CALCULATE (
DISTINCTCOUNT ( 'TableToCompare'[Bus unit] ),
'TableToCompare'[Bus unit] <> SelectedBus
)
Best regards,
Sha
Helper II
6 years agoPerfect, thank you so much!