8 Replies Latest reply on Apr 17, 2018 6:35 PM by willard van de bogart

    Combining Bar Chart and Line chart in Tableau

    Poonam Patil



      I am very new to Tableau. I have a question regarding combining Bar Chart and Line chart in Tableau.


      I have 2 fields, [Sales Type] and 'Sales'. [Sales Type] field has 2 values: 'Sales Marging' and 'Sales'


      I am Trying to show one chart in which I am showing bar chart for [Sales Type] and line chart for SM% (Calculation for SM% is : sales/sales Margin)


      I have created 3 calculated fields:

      1) Sales Type Margin:

      IF([Sales Type] = 'Sales Margin')

      THEN ([Sales])

      ELSE (0)


      2) Sales:

      IF([Sales Type] = 'Sales')

      THEN ([Sales])

      ELSE (0)


      3) SM%:

      sum([Sales Type Margin])/sum([Sales Type Sale]) ( And converting in percentage format)


      But I am not able to get correct value for SM%. Also I can see 'AGG(SM%)'

      I would really appreciate if anyone can help me on this.

      Thank you!