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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jcamilo1985
Helper III
Helper III

conditional formatting by row

A cordial greeting to all

I think that for some this topic will be familiar even very simple, but even so I have not managed to get the solution, I have no choice but to ask for your help.

I have a power bi matrix similar to the one in the image, what I need is to conditionally format the rows separately, so that the smallest numbers are redder and the most positive are greener, considering the fact that there are lines that can have both positive and negative values.

 

I appreciate any help in advance

 

 

matrix_example.png

 

 

1 ACCEPTED SOLUTION
DivkLearner
Resolver I
Resolver I

Hello @jcamilo1985

 

DivkLearner_0-1730870089620.png

 

I’ve successfully implemented the following steps:

  1. Created a custom column to calculate the sum of all columns.
  2. Created a custom column to compute the ratio of each column's value.
  3. Created a custom column for each ratio's corresponding hexadecimal color.
  4. Applied conditional formatting using the hex values generated from the ratios.

If you're interested, please let me know, and I'd be happy to share the PBIX file with you. The only limitation of my solution is that, as shown in the diagram, it currently only works for negative values. The intensity of the red color decreases as the negative value increases, which is the opposite of what you need.

 

DivKlearner, A bit forward daily. 

Link to my channel on Power BI.

https://www.youtube.com/watch?v=aADx2sPA2D0&list=PLDUIC70xSiVQQpfqGhOjBVDF8IBP2k6ob

 

View solution in original post

2 REPLIES 2
DivkLearner
Resolver I
Resolver I

Hello @jcamilo1985

 

DivkLearner_0-1730870089620.png

 

I’ve successfully implemented the following steps:

  1. Created a custom column to calculate the sum of all columns.
  2. Created a custom column to compute the ratio of each column's value.
  3. Created a custom column for each ratio's corresponding hexadecimal color.
  4. Applied conditional formatting using the hex values generated from the ratios.

If you're interested, please let me know, and I'd be happy to share the PBIX file with you. The only limitation of my solution is that, as shown in the diagram, it currently only works for negative values. The intensity of the red color decreases as the negative value increases, which is the opposite of what you need.

 

DivKlearner, A bit forward daily. 

Link to my channel on Power BI.

https://www.youtube.com/watch?v=aADx2sPA2D0&list=PLDUIC70xSiVQQpfqGhOjBVDF8IBP2k6ob

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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