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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors