Forum Discussion

Flappy8Flapjack's avatar
Flappy8Flapjack
New Member
3 years ago
Solved

Highlight filter when filter is used

Dear reader,

 

Please help me out. In my dashboard I have various filter options (dropdowns). My end-user would like to have the filters highlighted when used, but I can not figure out how to solve this in the visual options. For example, my dropdown box is now lightgrey, but when selected/used i would like to make it a darker colour. In the section when you can wright down 'if/or --> then' it only selects som. But That is not a solution for me. I hope someone can help me out. Thanks in advance!

 

Kind regards,

 

Jochem

4 Replies

  • I had the same requirement recently. Googling uncovered that border/background colors of slicers cannot be conditioned on a measure.

    My workaround was to place a rectangle around (and behind) the slicer (making it 100% transparent), and conditioning border color of said rectangle on a simple measure that checks if the slicer field is being used to filter - example below:

    IF(ISFILTERED('Table'[SlicerColumn])=TRUE(),1,0).

     

    If your slicer has multiple levels (3 for example), you can use IF(ISFILTERED('Table'[Column1])||ISFILTERED('Table'[Column1.1]||ISFILTERED('Table'[Column1.2]) = TRUE(),1,0) to check each one.

    The condition I applied to the rectangle's border color was based on the output of the measure being 1 or 0 - either orange, or white/colorless respectively)


    Pictured above - Slicer and conditionally formatted rectangle around dropdown

    It's probably too late for your requirement. Took me a while to figure this out, so throwing it out there for posterity 🙂

     

     

    • GeorgeVepkhvadz's avatar
      GeorgeVepkhvadz
      Helper I

      This is what I did as well, but there should definitely be simpler solution to this, then this workaround for the future. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Flappy8Flapjack ,

     

    As far as I know, Power BI only support us to filter the visuals by filter field or slicer. If you want to highlight your visual, I suggest you to create a visual (not slicer) and then use cross-highlight in Edit interactions option.

    For reference:

    Change how visuals interact in a Power BI report

    Filters and highlighting in Power BI reports

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

     

  • Not sure why answer was accepted as solution, but question wasn't about higlighting the visuals, but about highlighting the slicers which are in use with different colour.