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

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

Reply
Anonymous
Not applicable

Highlight Max month with different color

Hi, 

 

I'd like to show the max month for a clustered column chart to highlighte by defalault the max month only with a different color using conditional formatting. 

 

 I'm using the below DAX, yet it's not working;

 

User Trend Value:= var __HighValue = MAXX(ALLSELECTED(DateTable[Month Year]), [UniqueUsage%]) return IF([UniqueUsage%]=__HighValue, "#2AD2C9", "#4472C4")

 

DateTable[Month Year] looks like this:

 

monthYear.PNG

6 REPLIES 6
amitchandak
Super User
Super User

@Anonymous , You need max month of month with max value . That for month with max value

 


User Trend Value:= var __HighValue = MAXX(allselected(DateTable), DateTable[Month Year])
return IF(max(DateTable[Month Year])=__HighValue, "#2AD2C9", "#4472C4")

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
Anonymous
Not applicable

@amitchandak the color logic worked perfectly, yet it's highlighting Sep 2020. Not sure why is that!

@Anonymous , If the first one worked. The values making sure you take max at the month level, not below it.

 

If the second one worked. we are taking the max of the selected months and using it.

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
Anonymous
Not applicable

@amitchandak  I tried to use VALUES, however it's highlighting all bars in one sinle color neglecting the max month that is Dec 2020

amitchandak
Super User
Super User

@Anonymous , Try like

User Trend Value:= var __HighValue = MAXX(values(DateTable[Month Year]), [UniqueUsage%]) return IF([UniqueUsage%]=__HighValue, "#2AD2C9", "#4472C4")

 

I am assuming you are able to use conditional data color formatting with "field value" option

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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
Anonymous
Not applicable

@amitchandak  I tried to use VALUES, however it's highlighting all bars in one sinle color neglecting the max month that is Dec 2020

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.