3 Replies Latest reply on Oct 16, 2012 1:55 PM by Mark Holtz

    Color encoding based on measure names and dimension

    Vincent Dionne

      Hello,

       

      I would like to color encode a line chart based on the measure names and the year coming from a date dimension.  Any idea how to do this?

       

      thanks,

        • 1. Re: Color encoding based on measure names and dimension
          Mark Holtz

          Hi Vincent,

          Can you post your workbook?

           

          I'm not sure what you mean by coloring using the measure names AND the year of a date dimension.  I am fairly certain you can only color by a single "pill" be it the measure name OR the date part...

          • 2. Re: Color encoding based on measure names and dimension
            Vincent Dionne

            Hello,

            In the picture attached, I would like different coloration for the year (2011,2012) AND for both measures... For now the only way I found to distinguish them is to use the size shelf... but color would be definitely better.

             

            i also think that there is no direct way to do this, I wish someone has found a workaround.

             

            exempleTableau.png

            • 3. Re: Color encoding based on measure names and dimension
              Mark Holtz

              Hmmm...

               

              I think you could make a separate measure for the 2 2011 measures and for the 2 2012 measures? (Thus giving 4 separate measures)

               

              You'd accomplish this with something like these calculated fields:

              2012 Measure 1 calculated as:
              IF YEAR([DateField]) = 2012
              THEN [Measure1]
              END

               

              2012 Measure 2 calculated as:
              IF YEAR([DateField]) = 2012
              THEN [Measure2]
              END

               

              2011 Measure 1 calculated as:
              IF YEAR([DateField]) = 2011
              THEN [Measure1]
              END

               

              2011 Measure 2 calculated as:
              IF YEAR([DateField]) = 2011
              THEN [Measure2]
              END

               

              May not be as elegant as you'd like, but gets you a work around for now...

              1 of 1 people found this helpful