2 Replies Latest reply on Jun 21, 2012 3:43 PM by Dean Hewitt

    Need to create a stacked bar chart OR color code bar using multiple measures

    Dean Hewitt

      In Tableau I create a calculated item (RMA Cost) which consists of several sub-calculations (Fixed-cost, COGS-cost, Repair-cost, etc).  I can display the RMA Cost a bar chart using one of several dimensions (Product Family, Product Line, Ship Date, etc) .  I also want to color code each bar with the various sub components (Fixed-cost, COGS-cost, Repair-cost, etc).  OR create a stacked bar chart where each part of the stacked bar is a seperate measure. In this case they are the sub-calculations. 

       

      For example:

      Column Shelf: Product Family

      Row Shelf: RMA Cost

      Color on Marks Shelf:  ??? ( I want to have Fixed-cost, COGS-cost, etc. each shown as a different color.)

       

      How can I have multiple measures on the color mark, have each one a different color and have it show on the bar? 

       

      Dean Hewitt

        • 1. Re: Need to create a stacked bar chart OR color code bar using multiple measures
          Tracy Rodgers

          Hi Dean,

           

          You should be able to accomplish the desired outcome by placing Measure Names on the color shelf and Measure Values on the Level of Detail shelf (leave Product Family on the columns shelf and RMA Cost on the rows shelf). On the Measure Values card, put only the desired measures.

           

          Hope this helps!

           

          -Tracy

          1 of 1 people found this helpful
          • 2. Re: Need to create a stacked bar chart OR color code bar using multiple measures
            Dean Hewitt

            Hello Tracy,

             

            This gets the bar colored.  However the size of each part of the bar is not relative to the value.  In my example FIxed-cost is 3X COGS-cost which is 2X Repair-cost which is the same as Logistics-cost.  The bar is colored into 4 equal segments.  How do I get the segments to show relative size? 

             

            I think my basic issue is that each record has a single (RMA Cost) which consist of 4 parts.  I do not have 4 records, each with a sub component (Fixed-cost, COGS-cost, Repair-cost & Logistics-cost) along with a Dimension to indicate what value the RMA Cost has.  Then I could use the Dimension on the color shelf to color the bar defined by the RMA Cost. 

             

            So how can I replicate this new dimension?

             

            Regards,
            Dean

            1 of 1 people found this helpful