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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
v-yangliu-msft
Community Support
Community Support

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
Responsive Resident
Responsive Resident

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.



 

 

 

v-yangliu-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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