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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
_Mariamrs
Frequent Visitor

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

@_Mariamrs , 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")

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

@_Mariamrs , 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.

_Mariamrs
Frequent Visitor

@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

@_Mariamrs , 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.

@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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors