Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

How to create a custom slicer?

Hello!

 

I have this table:

 

ABC, 123

SDF, 235

RGD, 632

 

I want to create a slicer that will have two selection buttons/options:

2

3

 

When I click 2, it should filter the table to display the rows that contain '2' in the second column.

When I click 3, it should filter the table to display the rows that contain '3' in the second column.

 

Can you please share a pbix that can do that?

 

Thanks!

1 Reply

  • Hey UserPowerBI,

     

        The custom slicers are not too bad to make

       

        In this case I would go ahead and create a standalone table not connected to anything with the values you want to use as filters. In this case a the filter table would have two rows: '2' & '3'

     

        This is a measurement I have created that works with single select filters. Include this as a visual level filter for the table you want filtered with value = 1

     

    Filter For Table = 
    
    var SelectedValues = VALUES('Filter Table'[Filters])
    
    return
    
    IF(CONTAINSSTRING(MAXX('Original Table', 'Original Table'[Numbers]),SelectedValues), 1, 0)

        

     

     

     

     

     

    You could also download the custom visual "Text Filter" which would also do the trick and would not involve creating any measures or additional tables