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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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