10 Replies Latest reply: Oct 27, 2017 10:53 AM by Sinziana Lelescu RSS

    Create nested if statements in color by expression

    Sinziana Lelescu

      I created a positive-negative bar chart and I would like to implement 2 colors: green for positive values and red for negative values for example.


      Positive negative bar.jpg

      I have used two measures to obtain this chart a Min(value) and a Max(value), so when I insert a color expression I have something like this:

      =If(Min(Value) < 0, Green(), Red()) but I would like to create a nested if statement something like:

      =If(Min(Value) < 0, Green(), Red(),

           If(Max(Value) > 0, Green(), Red())

      But I'm not sure if I can use this approach in this case cause is not working. Any ideas how to create something like this?Thanks,