2 Replies Latest reply on Jul 17, 2016 9:03 PM by Nitin Joshi

    Conditional formatting on 2 measure in same sheet

    Nitin Joshi

      Hello There,

      been searching on web, but not finding it. for a single measure , it is working perfectly. But what i need is i've 2 different KPI's for 2 measures on same tableau sheet.

      Now i created 2 calculated field mentioning color code

      for 1st% measure

      [code]

      IF  attr([Unit])="XXX" and [1st%] <99.5  and attr([Product]) = "A1" Then "Red"

      ELSEif attr([Unit])="XXX" and [1st%] <96.5  and attr([Product]) = "B1" Then "Red"

      ..

      ..

      ..

      Else

      "Green"

      END

      [/code]

       

      and for Waste%

       

      [code]

      IF attr([Unit])="XXX" and [Waste%] >0.05  and attr([Product]) ="A1" Then "Red"

      ELSEif attr([Unit])="XXX" and [Waste%] >0.50  and attr([Product]) ="B1" Then "Red"

      ..

      ..

      ..

      Else

      "Green"

      END

      [/code]

      but when i drag this both calculated fields on color marks, it shows like below( image 2) which is not correct according to calculated fields. if 1st% for B1 < 96.5 then show red but  for 97.07 also it shows red but it should be green.

      2.png

       

       

      and when i remove one calculated field(1st%) it still doesn't change measure color for 1st%  see below image

      1.png

       

      why tableau not applying calculated field formatting for 2 individual measures correctly as mentioned in formula? is there any other way to have 2 measure CF in same sheet with different calculations?

       

      Regards!

       

      Message was edited by: Nitin Joshi