Forum Discussion

kellyylx's avatar
kellyylx
Helper I
2 years ago
Solved

Highlight cell based on another column

Hi, I have this table below and I want to highlight all records that belongs to an odd-numbered group 

 

nameaddress  Group
ACurrie Street 1
BMary Road Block 4    0
CStadium 60
ACurrie Street 1
GLuck Ave 3
DStanley Road2
DStanley Rd2
EChuan Road0
FGeorgia Ave 40
HKhatib Street0
IPeace Road0
GLuck Ave 3
GLuck Avenue 3

 

Expected output in dashboard:


how can i do this in powerbi?

 

  • Hi kellyylx 

     

    Thank you aduguid  for your solution! 

     

    I'd like to provide an additional approach, if you're not sure how many odd values you have, you can create a calculated column using this DAX formula:

     

     

    Then, you can apply a rule based on the "Odd" value in this new column to achieve the desired conditional formatting. This way, you can dynamically manage any changes in the "Group" values and ensure your formatting rules are always accurate.

     

    Best Regards,
    Muhammad Yousaf

     

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

     

    LinkedIn

     

2 Replies

  • aduguid's avatar
    aduguid
    Memorable Member

    While the table visual is selected right click on the column in the visualization pane and select "Conditional Formatting" | "Background Color" and then you can reference your "Group" measure.

     

     

  • muhammad_786_1's avatar
    muhammad_786_1
    Solution Supplier

    Hi kellyylx 

     

    Thank you aduguid  for your solution! 

     

    I'd like to provide an additional approach, if you're not sure how many odd values you have, you can create a calculated column using this DAX formula:

     

     

    Then, you can apply a rule based on the "Odd" value in this new column to achieve the desired conditional formatting. This way, you can dynamically manage any changes in the "Group" values and ensure your formatting rules are always accurate.

     

    Best Regards,
    Muhammad Yousaf

     

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

     

    LinkedIn