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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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 consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.