Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Frequent Visitor

conditional formatting with field value



I realised a matrix with a value switched to row.

I try to format the row with field value but I have a problem with the summarization who take the first or the last value for the all row.


The value of the field is green for postive value and red for negative value (the calculation is a little more complex but the idea is there.

The goal of this formatting is to have a colored staircase


Instead of green I would like to have red for negative value


Thanks for helping


Hi, @Morganld 

If the data value for this field is aggregated, please try again using 'SUM' instead of "SELECTEDVALUE".


Best Regards,
Community Support Team _ Eason

View solution in original post

Frequent Visitor

@parry2k I try to add a mesure for color,

color_mesure = if(SELECTEDVALUE('public stockview'[end_day_stock]) >= 0, "#32CD32", if(SELECTEDVALUE('public red_emergency_view'[stock restant + appro]) >= 0, "#FFA500", "#FF0000"))
But I have only the color green or orange, I have orange color for value 'public red_emergency_view'[stock restant + appro] < 0

Hi, @Morganld 

If the data value for this field is aggregated, please try again using 'SUM' instead of "SELECTEDVALUE".


Best Regards,
Community Support Team _ Eason

Frequent Visitor

@parry2k I use this column for conditional formatting -> field value but it doesn't work because of the summarization

= Table.AddColumn(#"Colonnes renommées", "couleur", each if [end_day_stock] >= 0 then "#32CD32" else if [#"stock restant + appro"] < 0 then "#FF0000" else if [#"stock restant + appro"] >= 0 then "#FFA500" else "")

Super User
Super User

@Morganld add a measure for color and then use that in conditional formatting -> field value


Color Measure = 
IF ( [My Measure] < 0, "Red", "Green" )



Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!


Visit us at, your one-stop shop for Power BI-related projects/training/consultancy.


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤

Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors