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

Conditional formatting help required?

Hi All,

 

I Seem to be stuck at what should be quiet a simple task. 

 

I have a table with four columns (fields) per row. All i want to is highlight each time the value in column 1 is less than any of the other 3 column valves.

 

As always any help would be greatly appreciated

 

KR

 

1 ACCEPTED SOLUTION
richbenmintz
Resident Rockstar
Resident Rockstar

Hi @dmoggie

 

You can create the following Measure 

back color = if(COALESCE([Val 1]<[Val 2], [Val 1]<[Val 3], [Val 1]<[Val 4])= BLANK(), "#FFFFFF", "#008000")

then use the Format by Field Value type of conditional formatting

 

richbenmintz_0-1596633166758.png

 

Linkt to Sample pbix, sample.pbix 

 

Hope this Helps,

Richard


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

 



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


View solution in original post

7 REPLIES 7
richbenmintz
Resident Rockstar
Resident Rockstar

Hi @dmoggie

 

You can create the following Measure 

back color = if(COALESCE([Val 1]<[Val 2], [Val 1]<[Val 3], [Val 1]<[Val 4])= BLANK(), "#FFFFFF", "#008000")

then use the Format by Field Value type of conditional formatting

 

richbenmintz_0-1596633166758.png

 

Linkt to Sample pbix, sample.pbix 

 

Hope this Helps,

Richard


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

 



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Wow so many quick replies, what a great forum. I didnt know you could resolve in all these different ways

 

@tex628 thanks.

 

This was the missing bit for me. Many thanks @richbenmintz 

 

Kind Regards

Anand24
Super User
Super User

Hi @dmoggie ,

 

Follow the below steps:

1. Create a new column with below condition:

Color_Column = if(Tablename[Column1] < Tablename[Column3],"Color's Hex Code","")
 
2. Go to Format -> conditional Formatting -> Enable Background color -> Format by: Field Value and Based on Field: Color_Column
 
Check below for example(Highlight Column1(Sixes) if No. of Sixes < No. of Fours(Column3)):
bg change.PNG
 
Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!
tex628
Community Champion
Community Champion

Assuming that it's measures you have it should be something along the lines of:

Measure = 
IF( [Measure 1] < [Measure 2] , 1 ,
IF( [Measure 1] < [Measure 3] , 1 ,
IF( [Measure 1] < [Measure 4] , 1 , BLANK()
)))


If you're just column aggregating i would recommend creating 4 measures instead:

Measure 1 = SUM(Table[Column1])

etc. 

Finally apply conditional formatting to Measure 1 and use the "Based on field" condition: 
image.png
Where you choose the measure written above with the condition 1 = Colored

Br,
J




Connect on LinkedIn
dedelman_clng
Community Champion
Community Champion

Hi @dmoggie  - create a measure or a column (depending on what your values are already), that produces 1 if your condition is met and 0 if it doesn't.  Then do conditional formatting on that field, but using the value of the new measure/column.

 

Hope this helps

David

amitchandak
Super User
Super User

@dmoggie , create a color measure like this and use that in conditional formatting with "Field" option

color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)

 

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
richbenmintz
Resident Rockstar
Resident Rockstar

Hi @dmoggie,

 

Can you provide some sample data and a desired outcome



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


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.