Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
manojk_pbi
Helper V
Helper V

Need help in adding conditional font/background color

Hi, 

I have data like below in a table RunRate is a measure. I would like add folor color based on logic. Pls help me how can it be done.

idealRunrate : 33% 

idealRate +/- 5% tollerance

IdealRate = 33+5 = 38% & 33-5 = 28%

Logic for font color - RunRate >= 28% && <=38% -> Green, Red

PRJOECTS#PrjRun Rate
PRJOJECT11834%
PRJOJECT21139%
PRJOJECT31227%
PRJOJECT4833%
PRJOJECT5936%
PRJOJECT6434%
PRJOJECT72536%
PRJOJECT81234%
PRJOJECT91336%
PRJOJECT10943%
PRJOJECT11846%
PRJOJECT12432%
PRJOJECT13 0%
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @manojk_pbi ,

 

Here are the steps you can follow:

1. Create measure.

Color =
var _idealRunrate=0.33
var _addidealRate=0.38
var _idealdecrease=0.28
return
IF(
    MAX('Table'[RunRate]) >= _idealdecrease&&MAX('Table'[RunRate])<=_addidealRate,
    "Green","Red")

2. Conditonal formatting – Background color.

vyangliumsft_0-1718589099727.png

3. Background color – RunRate.

Format style – Field value/

What filed should we base this on – [color]

vyangliumsft_1-1718589137819.png

4. Result:

vyangliumsft_2-1718589137821.png

 

Best Regards,

Liu Yang

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

 

View solution in original post

3 REPLIES 3
Ray_Minds
Continued Contributor
Continued Contributor

Step 1: - Right click on the measure/column for which you would like to apply
the formatting rule

Ray_Minds_0-1718632743578.png

Step 2: - In our scenario, we need to apply a conditional
formatting on Font color which can be selected by right clicking on the conditional
formatting option: -

Ray_Minds_1-1718632960562.png

Step 3: - Apply the below logic and click on OK.

Ray_Minds_2-1718632997254.png

                           
Output : -

Ray_Minds_3-1718633048136.png




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



 

 

 

Anonymous
Not applicable

Hi  @manojk_pbi ,

 

Here are the steps you can follow:

1. Create measure.

Color =
var _idealRunrate=0.33
var _addidealRate=0.38
var _idealdecrease=0.28
return
IF(
    MAX('Table'[RunRate]) >= _idealdecrease&&MAX('Table'[RunRate])<=_addidealRate,
    "Green","Red")

2. Conditonal formatting – Background color.

vyangliumsft_0-1718589099727.png

3. Background color – RunRate.

Format style – Field value/

What filed should we base this on – [color]

vyangliumsft_1-1718589137819.png

4. Result:

vyangliumsft_2-1718589137821.png

 

Best Regards,

Liu Yang

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

 

Kaviraj11
Super User
Super User

Hi,

 

Please follow the steps here:

Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

 

Opt for the Rules under Fotmat Style and select RunRate  and the apply the condition & colors accordingly.

 

If need any other help, let me know.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors