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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
carlosgeovany
Frequent Visitor

Highlighting the min & max values in a Power BI column chart

Hello,

I'm trying to highlight the max and min value from this chart:

 

carlosgeovany_0-1690290956139.png

To this:

carlosgeovany_1-1690291099871.png

I tryed using formating colors based on DAX measures like this:

Weekday = FORMAT([Date],"ddd")
Gold Meals Served Average = [Gold Meals Served] / DISTINCTCOUNT('Date'[Date])
!Max_Min Color = 
VAR GetAllDays = ALLSELECTED('Date'[Weekday])
VAR GetMaxValue= MAXX(GetAllDays, CALCULATE([Gold Meals Served Average]))
VAR GetMinValue= MINX(GetAllDays, CALCULATE([Gold Meals Served Average]))
RETURN
IF(
    [Gold Meals Served Average] = GetMaxValue,"#000e2f",
    IF([Gold Meals Served Average] = GetMinValue, "#ffda30","#b3b3b3")
)
carlosgeovany_3-1690291887277.png
 
But getting not expected result:
 
carlosgeovany_2-1690291850931.png

carlosgeovany_0-1690290956139.png

 
Any idea of what could be the problem?
 
Thanks
3 REPLIES 3
ERD
Community Champion
Community Champion

Hi @carlosgeovany ,

Your approach should work, but you need to check several things:

  • No need to put CALCULATE here: 

 

VAR GetMaxValue= MAXX(GetAllDays, [Gold Meals Served Average])

 

  • Check that GetMaxValue and GetMinValue return the values you expect
  • Make sure your measure returns the value of the Text format 

ERD_0-1690441296998.png

 



If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
Appreciate your Kudos
Stand with Ukraine! 

Hi, I made some progres but still no the desired output.

 

Problem is when I sort the column Weekday by the column WeekdayNum so I can see the days in order

 

carlosgeovany_0-1691009701205.png

 

As you can see above, now the colors are as spected, but when I try to sort it, the colors change to the same

 

carlosgeovany_1-1691009813294.png

 

carlosgeovany_2-1691009824255.png

 

Anonymous
Not applicable

Hi @carlosgeovany,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.