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
badger123
Resolver I
Resolver I

Highlight max value in column chart

Hi all,
 
I'm trying to figure out how to highlight the max value in my simple column chart. E.g. here I would like Feb 2019 bar to be a different colour from the rest. Please can someone help? 
 
Capture.PNG
 
I have got this so far: 
 
Measure1=
VAR MAXValue = MAXX( ALL( 'Table1'[Short_Date]), [Sum_Values] )
VAR TotalValues= [Sum_Values]
RETURN
IF(TotalValues= MAXValue, BLANK(), TotalValues)
 
Measure2=
VAR MAXValue = MAXX( ALL( 'Table1'[Short_Date]), [Sum_Values])
RETURN
IF( [Sum_Values] = MAXValue, MAXValue, BLANK() )
 
Where Sum_Values is a simple sum measure. Short_Date is a custom column I made to format the date in MMM-YYYY.
 
This isn't working for some reason. Please help! 🙂 
 
5 REPLIES 5
v-jiascu-msft
Employee
Employee

Hi @badger123,

 

The second one should work. Please refer to my test and the snapshot.

Measure =
VAR maxSales =
    MAXX ( ALLSELECTED ( 'Calendar'[Short_Date] ), [Sum_Values] )
RETURN
    IF ( [Sum_Values] = maxSales, [Sum_Values], BLANK () )

Highlight-max-value-in-column-chart

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-jiascu-msft for this. I tried following the steps but for some reason it's not working as expected. Do you know why this is? Is it because my Short_Date is text not date? When I use an actual date column it works. Is there a way I can format date MMM-YYYY?

 

Capture.PNG

Hi @badger123,

 

The Short_Date in such a format is surely a Text. It should be from an independent date table. I guess yours is from the fact table which contains the Values column. Isn't it? If so, I would suggest you create a new date table and establish relationships.

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

MMM-YYYY default option is not possible but MMMM yyyy is:

 

2019-02-07 11_08_15-05-01-Project-Population-Start - Power BI Desktop.png

Hi @SJim ,

 

Could you please mark the proper answers as solutions?

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.