Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I would like to ask you for help with following issue:
I have the table with 3 columns:
| CATEGORY | TARGET | PERFORMANCE |
| 1 | 110% | 109% |
| 2 | 115% | 110% |
| 3 | 130% | 140% |
And I need to somehow define the rules for conditional formatting (or other formatting) that if the performance of category 1,2 or 3 is lower than target in the same line put the cells background to red and if the performance of category 1,2 or 3 is higher than target put it green. Expected result is shown here:
| CATEGORY | TARGET | PERFORMANCE |
| 1 | 110% | 109% (red background) |
| 2 | 115% | 110% (red background) |
| 3 | 130% | 140% (green background) |
Thanks in advance for your help!
P
Solved! Go to Solution.
@Peter_2020 , Try like
if(max(table[PERFORMANCE]) <Max(Table[TARGET]) , "Red", "Green")
or
if(average(table[PERFORMANCE]) <average(Table[TARGET]) , "Red", "Green")
@Peter_2020 , Assuming [PERFORMANCE] and [TARGET] are measures
then create a color measure and use that in conditional formatting with field value option
if([PERFORMANCE] <[TARGET] , "Red", "Green")
refer for step
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Performance and Target are columns from imported excel table...
@Peter_2020 , Try like
if(max(table[PERFORMANCE]) <Max(Table[TARGET]) , "Red", "Green")
or
if(average(table[PERFORMANCE]) <average(Table[TARGET]) , "Red", "Green")
Hi,
I'm new to Power bi.
Where are you inserting the "if" statement into?
Thanks.
It works!!! Thank you very much!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |