6 Replies Latest reply: Sep 26, 2017 4:37 AM by Kay Birtze RSS

    Using alternative measures with colour by expression

    Kay Birtze

      Hi there,

       

      I was wondering, if it is possible to use alternative measures in a chart with colour by expression.

       

      Let's say i have the following data set:

       

      Name     Value1     Value2   

      A             1              2

      B             2              3

      A             1              2


      I create a bar chart with "Name" as dimension and a measure with sum(Value1). On top of that i declare sum(Value2) as alternative for my first measure.


      Now i want to colour the bars depending on their value. I want every bar with a value higher than 2 to be coloured green and the rest red.


      With only one measure it's kind of easy to use the following code: "if(sum(Value1) > 2, green(),red())", but is there a possibility to use a more generic code to make sure, this colour expression code is applicable to every measure I define?


      Thanks in advance!