Forum Discussion

vipinbharti121's avatar
vipinbharti121
New Member
5 years ago
Solved

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

  • 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 Li

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

4 Replies

  • v-yingjl's avatar
    v-yingjl
    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
    )
    

    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.

  • 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.

     

     

     

  • PaulDBrown's avatar
    PaulDBrown
    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?

    • vipinbharti121's avatar
      vipinbharti121
      New 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.

      UniversityCollegeSubjectsSales of books
      AXMaths, science, sociology35050
      BYScience, History21520
      CZPE, Arts, ED12500