1 Reply Latest reply on Jul 7, 2018 4:05 AM by Simon Runc

    Synchronise axis between two separate charts

    sanchita verma

      Hi,

      Please see the data attached. I am trying to achieve a dashboard displaying all states side-by-side. However, axis of State12 and State3 need to be synced and similarly axis of state 5 and 6.

       

      I am not sure whether this can be achieved by using a fixed reference line (in white colour) to both the graphs which represents the maximum of the value in either state12 or 3 (similarly for State5 &6)??

       

      Please help!

       

      Thanks in advance!

        • 1. Re: Synchronise axis between two separate charts
          Simon Runc

          hi Sanchita,

           

          So this is a little complicated, but possible...although (from your description) we'll need to hard-code the state combination you want to sync the axis....we also have the complication that we have 2 measures to check!

           

          so first I used the following LoD to pick up the MAX value for State 1 or 2, for Actual

          [Max State 1 and 2 Actual]

          {MAX

          (

          {FIXED datetrunc('month',[Date]), [State]:

          SUM(IIF([State]=1 OR [State]=2,[Actual],NULL))}

          )

          }

           

          and then the same for Projected

          [Max State 1 and 2 Projected]

          {MAX

          (

          {FIXED datetrunc('month',[Date]), [State]:

          SUM(IIF([State]=1 OR [State]=2,[Projected],NULL))}

          )

          }

           

          and then we can get the MAX of these...a little known feature in Tableau is that you can use a MAX, in the form MAX(Measure 1, Measure 2) as a dimension!, even though MAX can be an aggregate!

           

          [Fake Reference Line State 1 and 2]

          MAX([Max State 1 and 2 Actual],[Max State 1 and 2 Projected])

           

          we can then bring this into the Detail shelf and set up a reference line on both sheets. In the attached I've left it visible, so you can see what it's doing, but in the final version set the label and line to None. As we're using FIXED LoDs here, I've also had to make the Product filter a context filter, so it affects the LoD calculations.

           

          A much easier route would be to use the State in the columns, on a single sheet, and then you don't need any calcs, or reference lines (just use the Uniform Axis option). I've done this in "Simpler_SR" tab, in case that flies.

           

           

          Hope that helps, and makes sense.