Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Populating Slicer Dropdown with Keywords, rather than Full Cell

Hello, I've looked around but can't seem to find an answer on how to do this.  I am new to Power BI, though, so I may be missing something.

 

Say, for example, I have this data set:

AnimalColor
Black BearBlack
Polar Bear White
Panda BearBlack, White

 

I want to filter this data by color with Slicer, and the dropdown will give me the options of Black; White; or Black, White.

 

What I want instead is for my Slicer dropdown options to be Black and White, and for Panda Bear to show up when I select either Black or White.

 

This is obviously not my real data, but all data in the "Color" column would be comma delimited when there are multiple 'colors', if that helps with a solution.  Also, I am using the Cluster Map visualization with this (in case that's relevant).

 

I appreciate any advice on this!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    I created a sample pbix file(see attachment), please check whether that is what you want. 

    1. Create a color dimension table(DO NOT create any relationship with your fact table)

    2. Create a measure as below

    Flag = 
    IF (
        CONTAINSSTRING (
            SELECTEDVALUE ( 'Table'[Color] ),
            SELECTEDVALUE ( 'Color'[Color] )
        ),
        1,
        0
    )

    3. Create a slicer using the color field of color dimension table

    4. Create a table visual with visual level filter condition(Flag is 1)

    Best Regards

4 Replies

  • dhruvinushah's avatar
    dhruvinushah
    Responsive Resident

    This is a really good question. 
    The better way to tackle this so that the user can have a working solution would be to use the Filter Panel instead of a Slicer to filter by the Color. 
    Doing so will give you the option to filter the table based on the values inside the Color field. 
    Here is a screenshot of the same: 


    Please feel free to mark this as the solution if this answers your question. 
    A thumbs up below will be helpful too. 

    Thanks!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your response!  This is definitely a possibility, but I'm really hoping to use Slicer.  I plan to share the database with other members of my team who aren't familiar with Power BI, and it is much more user friendly to select from a dropdown list than to go in and create a custom filter.

       

      Maybe there is a way to add a Filter to the Slicer?  I'll look into it.

       

      Thanks again for your response.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    I created a sample pbix file(see attachment), please check whether that is what you want. 

    1. Create a color dimension table(DO NOT create any relationship with your fact table)

    2. Create a measure as below

    Flag = 
    IF (
        CONTAINSSTRING (
            SELECTEDVALUE ( 'Table'[Color] ),
            SELECTEDVALUE ( 'Color'[Color] )
        ),
        1,
        0
    )

    3. Create a slicer using the color field of color dimension table

    4. Create a table visual with visual level filter condition(Flag is 1)

    Best Regards

    • Anonymous's avatar
      Anonymous
      Not applicable

      This works!  Thank you so much.