Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

conditional colors in Bar Chart

Hi all

I tried to change color in a bar chart for Min and Max with following formula:

=if(sum({<[Fact.Type] = {'Sales'}>}Fact.Net_Rev_EUR)/Count (DISTINCT Fact.Order)={'$(=Min(sum({<[Fact.Type] = {'Sales'}>}Fact.Net_Rev_EUR)/Count (DISTINCT Fact.Order))'},RGB(255,0,0),RGB(0,0,0))

Could somebody helpm me with the formula?

thanks

Oliver

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

if(

     sum({<[Fact.Type] = {'Sales'}>}Fact.Net_Rev_EUR)

     /

     Count (DISTINCT Fact.Order)


     =


     Sum({'$(=Min(sum({<[Fact.Type] = {'Sales'}>}Fact.Net_Rev_EUR)

     /

     Count (DISTINCT Fact.Order)

     ,RGB(255,0,0)

     ,RGB(0,0,0)

)


Let me know

Not applicable
Author

unfortunately it doesn't work

Anonymous
Not applicable
Author

Hi Oliver,

Not sure if you have resolved this yourself but when dealing with dynamic colours like this I try to break out the functions in a table first to make sure they are behaving as expected. With your set analysis statements it would be very easy for a mistake to slip in. I would also consider bracketing each half of the comparison to make sure there is nothing odd going on.

Finally, be wary of direct comparison between non integer values, you might get interesting rounding artifacts which would give you unexpected results.