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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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
Solution Supplier
Solution Supplier

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.