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

# Multiple Dual Axis?

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?

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?

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 time Home Usage (kWh) Solar Energy (kWh) From Powerwall (kWh) From Grid (kWh) To Grid (kWh) Date To Powerwall (kWh) ToGridNeg 2019-03-01T01:00:00.000-05:00 17.1 0 0 17.2 0 3/1/2019 -0.1 0 2019-03-02T01:00:00.000-05:00 12.8 7.9 0 9.2 3.6 3/2/2019 -0.7 -3.6 2019-03-03T01:00:00.000-05:00 13.3 11 0 9.7 7 3/3/2019 -0.4 -7 2019-03-04T01:00:00.000-05:00 17.3 17.7 0 11.5 11.4 3/4/2019 -0.5 -11.4 2019-03-05T01:00:00.000-05:00 17 31 0 9.8 23.3 3/5/2019 -0.5 -23.3 2019-03-06T01:00:00.000-05:00 17 24.8 0 9.6 16.6 3/6/2019 -0.8 -16.6 2019-03-07T01:00:00.000-05:00 16.2 19.8 0 9 12.4 3/7/2019 -0.2 -12.4 2019-03-08T01:00:00.000-05:00 14.5 18.8 0 7.5 11.5 3/8/2019 -0.3 -11.5 2019-03-09T01:00:00.000-05:00 13 28.9 0 8 23.4 3/9/2019 -0.5 -23.4 2019-03-10T01:00:00.000-05:00 15.4 4.8 0 11.9 0.9 3/10/2019 -0.4 -0.9 2019-03-11T01:00:00.000-04:00 13.4 24.6 0 8.3 18.8 3/11/2019 -0.7 -18.8 2019-03-12T01:00:00.000-04:00 13.7 32.6 0 6.8 25.4 3/12/2019 -0.3 -25.4 2019-03-13T01:00:00.000-04:00 23.1 27.6 0 12.2 16.8 3/13/2019 0.1 -16.8 2019-03-14T01:00:00.000-04:00 14.2 26.2 0 7.7 19.3 3/14/2019 -0.4 -19.3 2019-03-15T01:00:00.000-04:00 11.1 17 2.6 3 11.1 3/15/2019 -0.4 -11.1 2019-03-16T01:00:00.000-04:00 11.8 30.7 6.6 0.1 19.2 3/16/2019 -6.4 -19.2 2019-03-17T01:00:00.000-04:00 13.5 33.2 7.4 0.1 18.5 3/17/2019 -8.7 -18.5 2019-03-18T01:00:00.000-04:00 16.1 27.5 8.2 1 12 3/18/2019 -8.6 -12 2019-03-19T01:00:00.000-04:00 14 33 7.6 0.1 17.9 3/19/2019 -8.8 -17.9 2019-03-20T01:00:00.000-04:00 10.2 29.5 3.4 3 17.2 3/20/2019 -8.5 -17.2 2019-03-21T01:00:00.000-04:00 12.2 3.2 0 9.5 0.5 3/21/2019 0 -0.5 2019-03-22T01:00:00.000-04:00 14.4 14.4 0 9 8 3/22/2019 -1 -8 2019-03-23T01:00:00.000-04:00 12.2 35.3 0 6.1 29 3/23/2019 -0.2 -29 2019-03-24T01:00:00.000-04:00 8.7 34.5 0 5.3 30.8 3/24/2019 -0.3 -30.8 2019-03-25T01:00:00.000-04:00 12.5 14 0 7.8 8.8 3/25/2019 -0.5 -8.8 2019-03-26T01:00:00.000-04:00 13.1 36.9 0 8.5 31.9 3/26/2019 -0.4 -31.9 2019-03-27T01:00:00.000-04:00 12.8 35.5 0 7.6 29.6 3/27/2019 -0.7 -29.6 2019-03-28T01:00:00.000-04:00 13.9 34.8 0 6.9 27.5 3/28/2019 -0.3 -27.5 2019-03-29T01:00:00.000-04:00 11.7 10.6 0 7.2 5.7 3/29/2019 -0.4 -5.7 2019-03-30T01:00:00.000-04:00 7 27.4 0 4.5 24.5 3/30/2019 -0.4 -24.5 2019-03-31T01:00:00.000-04:00 9.7 7.2 0 5.9 3 3/31/2019 -0.4 -3
• ###### 3. Re: Multiple Dual Axis?

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.

• ###### 4. Re: Multiple Dual Axis?

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?

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?

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