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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tommasopela
New Member

Matrix multiple conditional formatting: values and gradient

Hello,

 

I am trying to apply different conditions on a Matrix to highlight the cells:

 

1)

 value < Threshold1                         --> Green

Threshold1 <= value < Threshold2 --> Yellow

value >= Threshold2                        --> Red

 

As you can see from the photo I was able to do it, using conditional formatting by field value and by creating the measure Background_color:

 

Background_color =
IF(Min(FinalTable[Threshold1])=-1,"white"
,IF(Min('FinalTable'[value]) < MIN('FinalTable'[Threshold1]),"#1af329"
,IF(Min('FinalTable'[value]) >= MIN('FinalTable'[Threshold2 ]),"#ff0c0c"
,"#FFFF00")
)

tommasopela_0-1662113122074.png


The point where I'm struggling is:

When the Threshold is -1 (shown as blank value in the matrix), I would need the rows' background color to be formatted with a gradient:

GREEN for the smallest value in the row, RED for the highest value in the row, and a gradient for the values in between.

 

Is there a way to do it?

Thank you very much

 

 

1 REPLY 1
Anonymous
Not applicable

Hi  @tommasopela ,

 

This is the related document, you can view this content:

https://www.youtube.com/watch?v=TeeKcHjA8E0

 

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.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.