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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
manojk_pbi
Helper III
Helper III

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
Resolver I
Resolver I

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
Solution Sage
Solution Sage

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.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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