Forum Discussion

badger123's avatar
badger123
Resolver I
7 years ago
Solved

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! :) 
 
  • Hey,


    I created this measure:

    Measure = 
    var allthedatesused = ALLSELECTED('simple table'[some kind of date])
    var themaxvalue = MAXX(allthedatesused, CALCULATE(SUM('simple table'[quantity])))
    return
    IF(sum('simple table'[quantity]) = themaxvalue,"#ff6600")


    Then I assigned this measure to the data color (mark the chart, and select formatting window) advanced controls (formerly known as conditional formatting)

     

    and chose this setting:

     

     

    After that my sample chart will look like this:

     

     

    If this is not what you are looking for

    please provide a pbix with some sample data, upload the pbix to onedrive or dropbox and share the link.

     

    Regards,
    Tom

  • badger123's avatar
    badger123
    7 years ago

    TomMartens Awesome, thanks! It worked a treat. It seems to only work when using a column with date format and I'm trying to display axis like you have on the chart MMM YYYY or MMM YY. Do you know how I can do this? 

6 Replies

  • Hey,


    I created this measure:

    Measure = 
    var allthedatesused = ALLSELECTED('simple table'[some kind of date])
    var themaxvalue = MAXX(allthedatesused, CALCULATE(SUM('simple table'[quantity])))
    return
    IF(sum('simple table'[quantity]) = themaxvalue,"#ff6600")


    Then I assigned this measure to the data color (mark the chart, and select formatting window) advanced controls (formerly known as conditional formatting)

     

    and chose this setting:

     

     

    After that my sample chart will look like this:

     

     

    If this is not what you are looking for

    please provide a pbix with some sample data, upload the pbix to onedrive or dropbox and share the link.

     

    Regards,
    Tom

    • badger123's avatar
      badger123
      Resolver I

      TomMartens Awesome, thanks! It worked a treat. It seems to only work when using a column with date format and I'm trying to display axis like you have on the chart MMM YYYY or MMM YY. Do you know how I can do this? 

    • badger123's avatar
      badger123
      Resolver I
      TomMartens Awesome, thanks! It worked a treat. It seems to only work when using a column with date format and I'm trying to display axis like you have on the chart MMM YYYY or MMM YY. Do you know how I can do this? 
      • TomMartens's avatar
        TomMartens
        Super User
        Hey,
        cool that it works for you!

        Please prepare a pbix with sample data that reflects your table(s), upload the file to onedrive or dropbox and share the link.

        Regards,
        Tom