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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
manojk_pbi
Helper IV
Helper IV

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.