Forum Discussion
How to get common data from selected value in slicer
- 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,
Hi Sha ,
Sorry for that we forgot to put the sample pbix file in our previous post. The above visual comes from the origin table and the below is come from the copied table, we only applied the visual filter in the below visual. We did not set relationship between the two tables.
Best regards,
Thank you for your reply and help.
Top visual will include all Sales whether or not related to same client. I need to show only those related.
Bottom visual is great for the detail.
I'm now looking to roll that up to a summary, but when I change Bus Unit to distinct count and Sales to Sum, they now include the Bus Unit selected and I don't want that.