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
J_S_A
Helper I
Helper I

Conditional formatting by row

Hi all,

 

I'm wondering if anyone could help me solving this.

I have a visual table in Power BI that looks like this:

J_S_A_2-1742316140453.png

 

All columns have been calculated, based on the main table.

What I need to do is to apply a conditional formatting by row. So, for example, for row "CR Medium 20 - 60 MD" I need the value for "Average of Dev_Created_FuncSpec" (which is 38.58) to be red, and the lowest one to be green.

In other words, I need to compare the values by row and highlight the highest ones.

See example of what I mean in excel:

J_S_A_1-1742316099177.png

 

Is this possible?
Thanks in advance!

6 REPLIES 6
fahadqadir3
Super User
Super User

Hi, you need to create a color measure for each measure. Review the attached screenshot and power bi file.

RowMax = 
MAX( [Measure A], MAX( [Measure B], [Measure C] ) )

fahadqadir3_0-1742319829684.png

 

Case 2 when sales is less than other measures, color turns blue.

 

fahadqadir3_2-1742320291057.png

 

ColorMeasureA = 
IF( [Measure A] = [RowMax], "#FF0000", "#0000FF" )

ColorMeasureB =
IF( [Measure B] = [RowMax], "#FF0000", "#0000FF" )

Then apply conditional formatting, field value to each measure.

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Hi @fahadqadir3 ,
I'm trying to use the "RowMax" measure but it doesn't work in my case. I can only add 3 variables, but I have 5 variables (see below):

J_S_A_2-1742374279777.png

 

I get the variables from the third one afterwards underlied in the measure, so there should be an error/limitation:

J_S_A_1-1742374144092.png

Also, I would like to know what do you do with the "RowMax" and the colors measures. I don't see they are added in the filters nor the table.

 

Thanks!



hI @fahadqadir3 

I have created this measure to obtain the Max Deviation in each row:

MaxDeviation =
VAR ValuesTable = {
    [Average_Created_FuncSpec],  
    [Average_FuncSpec_Handover],  
    [Average_Handover_Delivery],  
    [Average_UAT_Deploy],  
    [Average_Deploy_Completed]
}

VAR MaxValue = MAXX(ValuesTable, [Value])

RETURN MaxValue

Then, i have created this measure for the color:
Color_Created_FuncSpec =
IF( [Average_Created_FuncSpec] = [MaxDeviation], "#FF0000", "#0000FF" )

But nothing changes.
Could you please help me?


Hi @fahadqadir3 , @andrewsommer 
Could anyone help me with the solution?
Thanks

andrewsommer
Super User
Super User

To start it looks like you are using implicit measures in your power bi table instead of explicit measures.  If you make explicit measures for those fields and then put them in the values field of a matrix visual.  In the formatting for the matric go to Values > Options > Switch values to rows.

 

Then you should be able to click on each measure in the Values box of your visualization to add conditional formatting to that field. 

 

Please mark this post as solution if it helps you. Appreciate Kudos.

 

Hi.
Thanks for advising to turn the measures into explicit ones. I've done it, but unfortunately I don't want the table to look like the matrix you have proposed. I want it to look like as I have attached.
Thanks anyway!

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.