6 Replies Latest reply on Aug 14, 2019 2:24 PM by Hari Ankem

    Multiple Dual Axis?

    Jordan Daleo

      I'm trying to combine two measures together to a single bar (that goes above and below 0), one is a negative value, one is positive (gray bars).


      If i only have one Measure in the row, and i drag the second (with the negative value) to the right side, it'll do what i want in a dual axis, but i can't do that for two sets of measures with other measures added as well.


      Any ideas? I'm fairly new to Tableau, so i'm sure there are many things that i'm missing here.


      All measures showing.


      Only two measures, i can do it. It'll place both the negative and positive in a single bar.


      I can even make two graphs correctly show the pos and neg in a single bar,  but they're two separate graphs.


      Adding the rest of the measures make all different charts.. I would like them all combined how they are now (with the gray and green combined, both pos and neg), as shown in the first image.

        • 1. Re: Multiple Dual Axis?
          Chris McClellan

          Firstly, I love looking at solar/battery data - I've spent a lot of time looking at my own data to manage my usage and save money


          Secondly, can you provide the data that you're using (even if it's just a sample or dummy values so that we can play with it)


          Finally, I think what you're trying to say is ..... the first graph has 6 bars clustered together (3 positive values and 3 negative values), which means you only want 3 bars (that each start from a negative value and go to a positive value).  This starts to feel more like a Gantt Bar chart rather than a (normal/plain) Bar because a plain bar graph will start at 0 and mark to the value (I know you've done it differently, but it's still 2 measures coloured the same to simulate a single bar).


          Bottom line is that in a dual axis you can do just that - two axes only, and you've already discovered when you use Measure Names/Measure Values you can't do different combinations on each axes.


          But please supply some sample/dummy data and we'll see what can be done.

          • 2. Re: Multiple Dual Axis?
            Jordan Daleo

            Chris McClellan,


            Sure thing! I really appreciate any help you can provide! I'm doing the same, as i see the wrong bars go up, i watch a little more closely to what's running at my house!


            Below is my data from March (when i had some actual Powerwall activity).


            Some background:

            I download: "Date time", "Home Usage", "Solar Energy", "From Powerwall", "From Grid" and "To Grid".

            I create: "Date" (based on Date Time), "To Powerwall" (since this data is not yet available to download, it's simply a calculation from the other fields), and "ToGridNeg" (which is just To Grid, but in the negative, so i could get it on the same bar as From Grid. Therefore "To Grid" is not used). Currently I made a calculated field in Tableau for "ToGridNeg", but i think i'm going to have it calculated in Excel so all of the data is coming into Tableau clean and unaltered.


            "Home Usage" is always positive and on it's own.

            "Solar Energy" is always positive and on it's own.

            "From Powerwall" is always positive, "To Powerwall" is always negative and both should be on a single bar.

            "From Grid" is always positive, "ToGrigNeg" is always negative and both should be on a single bar.


            So i'm looking for 4 total bars, Usage, Solar, Powerwall and Grid to mimic the image below.


            I wish i could save the twbx file, but since i'm using the free public version, i don't think i can.


            This is how the data looks with Tesla in the app, that i'm trying to duplicate so i can build it out and see all of my data in one shot.





            Date timeHome Usage (kWh)Solar Energy (kWh)From Powerwall (kWh)From Grid (kWh)To Grid (kWh)DateTo Powerwall (kWh)ToGridNeg
            • 3. Re: Multiple Dual Axis?
              Chris McClellan

              I tried a few different ways but can't make the bars work like that.


              Personally, I prefer lines to show the values, because some of these values shouldn't be stacked together.


              Hopefully someone else can help you

              • 4. Re: Multiple Dual Axis?
                Hari Ankem

                Will this work?



                If yes, then I have first pivoted the data and then created a calculated field as shown below and displaying it as the X-axis.



                A 2019.2 workbook is attached for reference.

                • 5. Re: Multiple Dual Axis?
                  Jordan Daleo

                  Chris McClellan I truly appreciate your help!

                  Hari Ankem That is exactly what i'm looking for, thank you very much! I still have a lot of formatting to do with other areas of my visualization, but this worked perfectly!


                  Is there an easy way to hide one or two of the colors in the legend without hiding the whole bar in the chart? (Ex, i don't need "To Grid" and "From Grid" to both show, i could simply name one "Grid" and hide the other. Same with the Battery.)

                  • 6. Re: Multiple Dual Axis?
                    Hari Ankem

                    You can create another worksheet with the required values and show that as a legend for the current sheet on a dashboard.