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.
I am not sure if my measure is wrong or whether I should apply this formatting differently.
Welcome to the Forum!
And thanks for supplying your work in progress file
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")