Forum Discussion

ELW's avatar
ELW
Advocate II
6 years ago
Solved

Highlight Scatter Graph Based on Slicer Selection

I need to highlight one record on a scatter graph based on the selection from a slicer.  As a simplified example, rather than filtering or not affecting the scatter plot here, when Tucson is selected I'd like to show the Tucson icon in a different color. 

I think this may be accomplished through a measure that shows 1 if the City is selected and 0 if not, but I have been trying for hours and am unable to get anything to work.  Help is greatly appreciated.  I've seen the Diabetes example with bar charts and am unable to get it to work, but I'm not a pro at DAX.  

  • ELW you can easily achieve with the following:

     

    - add a table for the slicer , it should not have a relationship with your data table

    - add following measure

     

    Red Selected Color = 
    IF ( SELECTEDVALUE ( Slicer[Column] ) = SELECTEDVALUE ( Table[Column] ), "Red" )

     

    on conditional formatting, choose field value and above measure and it should be good to go.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

5 Replies

  • ELW you can easily achieve with the following:

     

    - add a table for the slicer , it should not have a relationship with your data table

    - add following measure

     

    Red Selected Color = 
    IF ( SELECTEDVALUE ( Slicer[Column] ) = SELECTEDVALUE ( Table[Column] ), "Red" )

     

    on conditional formatting, choose field value and above measure and it should be good to go.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

      • ELW's avatar
        ELW
        Advocate II

        Thanks much, parry2k!  I'm able to add the measure (and it's working awesome elsewhere) but I can't figure out how to get it working with Conditional Formatting.  

         

        If I go to Data Colors / fx / Field Value I can select the measure Red Selected Color, but it doesn't have any options associated with changing the color based on the field value.  

         

        I've played around with it a bit, and nothing seems to get the formatting to work!