4 Replies Latest reply on Jan 14, 2014 9:48 AM by Jean Jacques Potgieter

# How do I create two different labels for a stacked bar chart, giving each measure a different label?

I have a dual axis stacked bar chart. The first data set is for hours worked that weren't billed, the second set is for billed hours. I want each to have a label that shows a percentage of the total hours worked, but I don't know how to create the calculated field.

I can do a calculation for percent of non-billed hours or a percent for billed hours, but when I try to apply the label to only one data set, it automatically applies it for both.

• ###### 1. Re: How do I create two different labels for a stacked bar chart, giving each measure a different label?

Jean:

Can you add the workbook to the discussion, as it helps to look at the issue with the data you are using and it also helps to fix the issue (by the forum) and send it back to you. Thank you

..kk

• ###### 2. Re: How do I create two different labels for a stacked bar chart, giving each measure a different label?

Figured it out. I had problems because I'm new to Tableau so I'll explain it to anyone else that is new and is having the same issue (It's pretty easy). I split the calculated field into the two fields, Non-Billable and Billable Values, then I put them on the rows area. Next, I converted the graph to a dual axis graph and synced the axis (right click the second Y axis and click synchronize axis).

Under the pages I found the Marks page. Under the marks page (The information just left of the graph) I found 3 pages: All, SUM(Non-Billable Value), and SUM(Billable Value). I clicked the first data set: SUM(Non-Billable Values). From there I was able to click the Label button and click Min/Max. I changed the field to calculation 1, set the scope to cell, and uncheck the show maximum value checkbox.

Then I went to the second data set: SUM(Billable Value) and did the same thing, changing the field to calculation 2.

• ###### 3. Re: Re: How do I create two different labels for a stacked bar chart, giving each measure a different label?

Jean:

I am glad you solved the issue by splitting the calc. field into two fields. I was looking into another option where you can't split the fields and attached is the sample. It doesn't look that pretty, but does the job.

- Create a parameter (ShowNum) and set the value to 1

- Place the ShowNum on the Row.

- Select the ShowNum mark and set the color transparency to 0%. Now the bars are hidden

- Select the Label mark and check 'Show Marks Label'

- Edit ShowNum Axis and uncheck Include Zero option. Now you see the numbers in the middle

- Select ShowNum and make it a dual axis and hide the header

An option in case you can split the fields.

..kk

1 of 1 people found this helpful
• ###### 4. Re: How do I create two different labels for a stacked bar chart, giving each measure a different label?

That's a very clever solution. I'll remember this in case I need it someday, thanks