2 Replies Latest reply on Sep 30, 2016 8:41 AM by chad.mangan

    Assigning 2015 data as a different chart type




      This is my first post in the tableau community so please be gentle :-).


      Basically, I am trying to create a combination graph with a line and a bar chart. I have monthly data going back to 1/1/2015. I'd like to have the 2015 metrics be represented by a line, and the 2016 metrics represented as a bar chart. This way the customer can see what their performance was last year which helps set expectations. Below is an example of what I'm trying to accomplish.


      example graph.png


      I was able to add the data by MONTH, and use the color tool for YEAR. But without two different marks I don't see how I can change the chart type just for 2016 data.


      Any help would be greatly appreciated!

        • 1. Re: Assigning 2015 data as a different chart type
          Dinesh Sundar Gomathinayagam

          Hi Chad M

          I have used a similar chart before and understand what you are trying to present here. When I created this, I created two calculated fields - one that contained the 2015 numbers and one with the 2016 numbers (this can be created with a simple CASE or IF statement). Then I placed the 2015 numbers on the primary axis as a bar graph and the 2016 numbers on the secondary axis as a line graph.


          I am also new to the tableau community and any feedback on the answer is appreciated. Thank you!

          1 of 1 people found this helpful
          • 2. Re: Assigning 2015 data as a different chart type

            Thank you, Dinesh Sundar!


            I was thinking I would need separate measures for the years, but had a difficult time conceptualizing when/where I needed to perform calculations on the data.


            To summarize: I created two calculated fields, one for 2015 and one for 2016.

            • CASE YEAR([Date])
              • WHEN 2015 then [Sales]
              • END


            For the visualization piece I added MONTH to the columns, and summed '2015 Sales' and '2016 Sales' in the rows. I also added a YoY % change metric as a label.


            Thanks again!