3 Replies Latest reply on Mar 1, 2016 5:28 AM by Jonathan Legare

    Measure Values on Color Shelf not Evaluating % Diff Correctly

    Jonathan Legare

      Not sure if it's a limitation in how Tableau handles measure values on the color shelf, or perhaps if I'm doing something wrong. I have two measures in measure values, both calculating a percent difference on table down. Then dropped the measure values to the color shelf to generate a highlight table - set -0.15 for the low, 0 center, and 0.15 for the high, and values which should be in the 'middle' step of just white are being highlit. Specifically my first value which is 6%, ~0.0599 is showing green, should be white.

       

      Am I doing something wrong or missing something here? I've searched forums and tried just about everything I know to and it just won't act right.

       

      Highlight table.PNG

        • 1. Re: Measure Values on Color Shelf not Evaluating % Diff Correctly
          Tharashasank Davuluru

          Hi,

           

          Yes you are right its a limitation in tableau. You cannot do it directly. Please post look at this idea which is posted byJonathan Drummey

          Conditional Formatting of Measure Names/Measure Values

          • 2. Re: Measure Values on Color Shelf not Evaluating % Diff Correctly
            Jonathan Drummey

            @Therashasank there's a way around this, it just needs a little arithmetic.

             

            @Jonathan - I believe you've set up your color palette like this, is that correct?

             

            Screen Shot 2016-03-01 at 7.06.58 AM.png

             

            There are two things going on here:

             

            1) The Start & End settings for the color ramp are telling Tableau that everything below (for Start) or above (for end) those values will get the appropriate end color of the range.

             

            2) All values in between the -0.15 and 0.15 are evenly distributed across the color ramp, which in your case has been reduced to three colors - red, white, and green. So red goes from below -0.15 to -0.5, white from -0.5 to 0.5, and green from 0.5 to .15 and up. I set up an example using CoffeeChain data:

             

            Screen Shot 2016-03-01 at 7.16.39 AM.png

            Amaretto/Oregon/2013 is -5.26% and is red, while Caffe Mocha/New Hampshire/2012 is -4.8977% and is white.

             

            Therefore, to get your color ramp we need to adjust the end points so Tableau's algorithm will spread them evenly across the range. If you want white from -0.15 to 0.15 that's a range of 30 points. So the spread needs to be 30 * 3 colors = 90 points. Since you're diverging in both directions from 0 that means 90/2 = 45, so the end points need to be -0.45 and 0.45:

             

            Screen Shot 2016-03-01 at 7.20.54 AM.png

             

            Then the color ramp will break at the right points, in this case Columbian/Oregon/2013 is 14.8% and Decaf Irish Cream/Iowa is at 15.2%:

             

            Screen Shot 2016-03-01 at 7.21.36 AM.png

             

            These are approximations, if you want exact values you might need to tweak the end points slightly (I'll probably play with this over the next couple of days to see).

             

            Depending on your data and your view there might be an option for using a Discrete (blue) pill based on a calculated field, if you provided more details about your view and what is displayed (for example there are two measures on Measure Values but I'm only seeing one in the view in the screenshot) I could take a look.

             

            Jonathan

            4 of 4 people found this helpful
            • 3. Re: Measure Values on Color Shelf not Evaluating % Diff Correctly
              Jonathan Legare

              Hey Jonathan, 100% correct. Was using two measure values in my example, as many as four on the dashboard I'm building. Guess my understanding of the banding was a bit lacking, but your solution seems to work perfectly.

               

              Thanks!