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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vipinbharti121
New Member

Filter a slicer based on selection in Table

I have one power bi Table :

UniversityCollegeSubjects
AXMaths, science, sociology
BYScience, History
CZPE, 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:

UniversityCollegeSubjects
AXMaths, 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

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community 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
)

m1.pngm2.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Yingjie Li

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yingjl
Community Support
Community 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
)

m1.pngm2.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Yingjie Li

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

PaulDBrown
Community Champion
Community Champion

@vipinbharti121 

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?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.

UniversityCollegeSubjectsSales of books
AXMaths, science, sociology35050
BYScience, History21520
CZPE, Arts, ED12500
MFelix
Super User
Super 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.

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.