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
Anonymous
Not applicable

conditional formatting with field value

Hi,

 

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.

Morganld_2-1663772141100.png

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

Morganld_1-1663772062355.png

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

 

Thanks for helping

1 ACCEPTED SOLUTION

Hi, @Anonymous 

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

4 REPLIES 4
Anonymous
Not applicable

@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, @Anonymous 

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

 

Best Regards,
Community Support Team _ Eason

Anonymous
Not applicable

@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 "")

parry2k
Super User
Super User

@Anonymous 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 https://perytus.com, 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

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.