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

Highlight minimum value for each column in Matrix

Hi All,
I am new to Power BI and working on highlighting the value which is lowest in a column. I have a matrix with Customer in Rows, column B in columns coming from  Mat table and say Values in values.Screenshot below -

askpbiuser_0-1701250040256.png

 

 

 

I want to highlight 8.67 value but it is visible when i put the background field next to it for testing and if I remove it, i dont see the colour anymore (which is the ask). Also i observe lot of inconsistency with this code.

Code that i wrote but is not working as expected -

Background Color by Customer =

VAR _1 = CALCULATETABLE(
ADDCOLUMNS
(SUMMARIZE('Fact','Dim Customer'[Customer], 'Mat'[B]),
"@NET", [Value]
),
ALLSELECTED('Dim Customer')
)
VAR MinValue = MINX ( FILTER(_1, [@NET] <> BLANK()), [@NET] )
VAR MaxValue = MAXX ( _1, [@NET] )
VAR CurrentValue = [Value]
VAR Result =
SWITCH (
TRUE,
CurrentValue = MinValue, 1, -- 1 for MIN
CurrentValue = MaxValue, 2 -- 2 for MAX
)
RETURN
Result

My table can have blank values and i need to ignore those. Also i have slicers on this page coming from different tables. I do have a filter implented to this matrix too coming from Fact table to check for valid records ( flad where isvalid = true). 

Please help!

1 REPLY 1
amitchandak
Super User
Super User

@askpbiuser , Create a measure like the below Assuming the value is measure and use that in conditional formatting using field value option



COlor =
var _tab = SUMMARIZE('Fact','Dim Customer'[Customer], 'Mat'[B],"@NET", [Value])
Return
Switch(True(),
[Value] = maxx(_tab, [@Net]), "Green",
[Value] = minx(_tab, [@Net]), "Red"
)

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.