Forum Discussion
Filter a slicer based on selection in Table
I have one power bi Table :
| University | College | Subjects |
| A | X | Maths, science, sociology |
| B | Y | Science, History |
| C | Z | PE, Arts, ED |
Here subjects column is concatenated.
There is one slicer "Subject" which should be filtered based on user interaction on above table.
| Subjects |
| Maths |
| Science |
| Sociology |
| History |
| Arts |
| ED |
| PE |
Suppose a user click on first row in above table:
| University | College | Subjects |
| A | X | Maths, science, sociology |
then subject slicer should be filtered based on the value on that row.
therefore it should be-
| Subjects |
| Maths |
| Science |
Sociology |
Thanks in advance.
Vipin
Hi vipinbharti121 ,
Basically visuals could not filter slicers so you can use the subjects field to create another table visual as a 'slicer'.
Create this measure, put it in the visual filter and set its value as 1:
Control = IF ( COUNTROWS ( FILTER ( 'Table', CONTAINSSTRINGEXACT ( 'Table'[Subjects], SELECTEDVALUE ( Subjects[Subjects] ) ) ) ) > 0, 1, 0 )Attached a sample file in the below, hopes to help you.
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- v-yingjlCommunity Support
Hi vipinbharti121 ,
Basically visuals could not filter slicers so you can use the subjects field to create another table visual as a 'slicer'.
Create this measure, put it in the visual filter and set its value as 1:
Control = IF ( COUNTROWS ( FILTER ( 'Table', CONTAINSSTRINGEXACT ( 'Table'[Subjects], SELECTEDVALUE ( Subjects[Subjects] ) ) ) ) > 0, 1, 0 )Attached a sample file in the below, hopes to help you.
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- MFelixSuper User
Hi vipinbharti121 ,
In PBI the slicer visualizations work differently from other visualizations. If you are abble to filter information on any visualization to other, being the slicer a filtering visualization you can only filter slicers with the filter pane or with other slicers you are not abble to select data from a table or a chart and have the slicer being filtered.
- PaulDBrownCommunity Champion
Following on from MFelix comment, you might try using a table visual (instead of a slicer visual) as your "slicer" and instruct users accordingly
EDIT: you might actually be able to use a Slicer with a filter measure applied in the filter pane. Do you have a sample dataset to play with?
- vipinbharti121New Member
Thanks @PaulDBrown
I have tried to create a measure which should filter slicer but yet not succeded.
I will not be able to provide the real data but I will try to replicate the scenerio.
There is one more field, numeric field: Sales of Books of that subject.
University College Subjects Sales of books A X Maths, science, sociology 35050 B Y Science, History 21520 C Z PE, Arts, ED 12500