Forum Discussion
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
| name | address | Group |
| A | Currie Street | 1 |
| B | Mary Road Block 4 | 0 |
| C | Stadium 6 | 0 |
| A | Currie Street | 1 |
| G | Luck Ave | 3 |
| D | Stanley Road | 2 |
| D | Stanley Rd | 2 |
| E | Chuan Road | 0 |
| F | Georgia Ave 4 | 0 |
| H | Khatib Street | 0 |
| I | Peace Road | 0 |
| G | Luck Ave | 3 |
| G | Luck 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 YousafIf this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.
2 Replies
- aduguidMemorable 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_1Solution 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 YousafIf this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.