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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Conditional formatting in power bi

Hi Everyone,

 

I have a requriment where i have to display the values of a column in  red, yellow and green color based on the conditon given below:

Display the following colors for efficiency %

1. If <80 show as red

2 If 80 - 85 show as yellow

3. If >85 show as green

 

I have tried to do the above using conditional formatting option in powerbi but my result is not proper.( The value in yellow should be green ideally)

Mshubhangi_0-1667462194671.png

The formual i have used in conditional formaating is this:

Mshubhangi_1-1667462317067.png

Can anyone please help me with this.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous,

The rule mode conditional formatting may not work properly when handling the aggregate values of the value field.  

For this scenario, you can consider using expression-based conditional formatting:

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

You only need to write a measure formula to extract and summary the current value field value and use it as often in the if statement to return color codes.

formula =
VAR currValue =
    SUM ( Table[Amount] )
RETURN
    IF ( currValue > 0.85, "Green", IF ( currValue >= 0.8, "Yellow", "Red" ) )

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous,

The rule mode conditional formatting may not work properly when handling the aggregate values of the value field.  

For this scenario, you can consider using expression-based conditional formatting:

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

You only need to write a measure formula to extract and summary the current value field value and use it as often in the if statement to return color codes.

formula =
VAR currValue =
    SUM ( Table[Amount] )
RETURN
    IF ( currValue > 0.85, "Green", IF ( currValue >= 0.8, "Yellow", "Red" ) )

Regards,

Xiaoxin Sheng

JorgePinho
Solution Sage
Solution Sage

Hello @Anonymous !
I prefer to do conditional formatting with a measure. 

 

I would do it like this:

1. Create a DAX Measure

SWITCH(
TRUE(),
table[column] < 0.8, "Red"
table[column] >= 0.8 && table[column] < 0.85, "Yellow",
table[column] > 0.85, "Green",
"White")

Note: you can put a specific colour code instead of writing down the name.


2. Apply conditional formatting based on a field value and select the measure

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!

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
Top Kudoed Authors