Highlighting max value within chart

Hi all,
I am trying to highlight a column with max value within my chart, but formula does not seem to work correctly, because it highlights everything, not just one column.

Measure I used for this is called Max Value and I inserted it in Format-Data Colors-fx and chose Format by Field Value, Based on Field Max Value.

image

I am not sure if my measure is wrong or whether I should apply this formatting differently.

Thanks for help
Nina
PB_max_value.pbix (3.5 MB)

Hi @Nina,

Welcome to the Forum!
And thanks for supplying your work in progress file :+1:

The ‘problem’ is that you are using ALLSELECTED(Dates[Month & Year]) in your calculation, that only returns one value for each Column in your visual (with [Month & Year] on the Axis), so you have to change the filter context for your calculation, something like this will do

Max Value = 
var maxvalue =  
    CALCULATE(
        MAXX(ALLSELECTED(Dates[Month & Year]),CALCULATE(SUM(Sales[Line Sales]))),
        REMOVEFILTERS( Dates[Month & Year], Dates[MonthnYear] )
    )
return
IF(SUM(Sales[Line Sales])=maxvalue, "#ff0000")

I hope this is helpful.

Works great, thank you for the explanation :slight_smile: