Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

highlight selected values in a table based on slicer selection

HI

 

I have a table:

I have a measure that links to a slicer based on the users selection

Measure = SELECTEDVALUE('Table'[label])
 
I would like to be able to highlight a different row of the table based on the selection of the slicer
 
Any suggestions

 

  • Hi Anonymous 

    Based on your discription, you want to highlight a differenct row when you select a value in slicer. and I've created a sample for you,

    -

    Steps:

    Create another table for slicer, in this table you need to add a column, when you select column label in slicer, then it will change the format of the row according to the relationship between column label and HightLightAnotherRow.

    Then, create the measure:

     

    conditional format =
    var _sel=SELECTEDVALUE('Table (2)'[HighlightAnotherRow])
    return
    IF(MIN('Table'[label])=_sel,"Yellow")

     

    Put the measure into the Background color of Values you want,

    Result:

    If you want the whole row highlighted, then change the Background color of “value” also.

    Result:

     

    Best Regards,

    Community Support Team _ Tang

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

3 Replies

  • v-xiaotang's avatar
    v-xiaotang
    Icon for Community Support rankCommunity Support

    Hi Anonymous 

    Based on your discription, you want to highlight a differenct row when you select a value in slicer. and I've created a sample for you,

    -

    Steps:

    Create another table for slicer, in this table you need to add a column, when you select column label in slicer, then it will change the format of the row according to the relationship between column label and HightLightAnotherRow.

    Then, create the measure:

     

    conditional format =
    var _sel=SELECTEDVALUE('Table (2)'[HighlightAnotherRow])
    return
    IF(MIN('Table'[label])=_sel,"Yellow")

     

    Put the measure into the Background color of Values you want,

    Result:

    If you want the whole row highlighted, then change the Background color of “value” also.

    Result:

     

    Best Regards,

    Community Support Team _ Tang

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

  • selimovd's avatar
    selimovd
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hey Anonymous ,

     

    in general you can change the color with a measure and conditional formatting:

    https://docs.microsoft.com/power-bi/create-reports/desktop-conditional-table-formatting#color-based-on-a-calculation

     

    I don't know your scenario well. But if you use SELECTEDVALUE, this means that a slicer is involved. Then the other values wouldn't show up. So I'm not sure if that makes sense.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
  • PaulDBrown's avatar
    PaulDBrown
    Icon for Community Champion rankCommunity Champion

    If you want the visual to maintain rows but highlight based on the selection in the slicer, you need to create an unrelated table to use as the slicer and the use a measure using SELECTEDVALUE or TREATAS to use in the conditional formatting interface.