1 Reply Latest reply on Aug 21, 2018 7:58 PM by swaroop.gantela

    Adding different filters to two graphs on same sheet

    Steven Cunden



      I'm new to Tableau so forgive me if this is a dumb question. I just figured out how to add filters on a sheet in general. But now that I have two graphs on the same chart (on the same axes) I'm wondering how I can apply different filters to each line graph.


      My table looks something like this.


      Store Number | Test | Control | $ Sales

                1            |  0  |  1  | $...

                2            |  0  |  1  | $...

                3            |  1  |  0  | $...

                4            |  1  |  0  | $...

                5            |  1  |  0  | $...


      I want to be able to have on the same sheet, a line chart for stores with test = 1, and another one with control = 1. Right now, all I have is the control and test columns as filters, and I'm toggling them when I want to see one over the over but I want to be able to have the two lines on the same graphs.



        • 1. Re: Adding different filters to two graphs on same sheet



          Welcome to the Forum.


          I may not have caught the gist, but I think there may be a few ways

          to get the line chart with test vs. control. I'll show a couple, maybe

          they can give ideas.


          You could make a Test or Control calculated field:

          IF [Test]=1 THEN "Test"

          ELSEIF [Control]=1 THEN "Control"



          You could then plot date vs. sales and put the [Test or Control]

          field on the Color shelf.


          Another method is to pivot your data which can be done in Prep or by:

          Pivot Data from Columns to Rows


          Then no calculated field is needed, just Pivot Field Name

          (which will be Test or Control) on the color shelf, and

          Pivot Field Value (which is one or zero) on the Filter shelf

          selecting for 1.


          These may be overly simplistic for your true dataset and setup.

          Happy to try to adjust as needed.


          Please see the workbook v10.3 attached in the Forum Thread.