3 Replies Latest reply on Aug 12, 2018 8:15 PM by Deepak Rai

    stacked bar chart


      I'm new to the forum and would appreciate any help.  I changed the labels of the data, but essentially I have different body parts from multiple people and each body part undergo 4 surgeries.  I want to create a stacked bar chart to view the number of different surgeries by month.


      I really could use some help.  Thank you, Lisa


        • 1. Re: stacked bar chart
          Ankit Bansal



          It would be helpful if you could attach the excel . Anyway I know what you have to do.


          You need to pivot your data first. In the data source pane select all 4 surgery columns and click on Pivot. Your data will look like something like this:


          Body Part , pivot name , pivot value

          Knee,           1 surgery,    12/30/2018

          Knee,           2 surgery,    3/30/2019

          Knee,           3 surgery,    2/28/2019

          Knee,           4 surgery,    7/28/2019


          ... and so on.


          Then you can just put pivot value on row shelf and count(pivot name) on column shelf. And then drag pivot name on color.


          Hope it helps.



          Ankit Bansal

          • 2. Re: stacked bar chart
            LISA MOORE

            thank you.  I do not have the Pivot option on my menu and after doing some research I think it is because the columns I need to pivot are calculated columns.  I found a solution to make a copy of the data, but my data is quite large and my tableau just spins when trying to bring up the copy option.


            Any other suggestions?  I am not able to provide the data; it's proprietary to my company.

            • 3. Re: stacked bar chart
              Deepak Rai

              In that case prepare and aggregate your data using Tableau Prep and then create view