Forum Discussion

badger123's avatar
badger123
Resolver I
7 years ago

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? 
 

 
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

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft 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,

    • badger123's avatar
      badger123
      Resolver I

      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?

       

      • SJim's avatar
        SJim
        Frequent Visitor

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