1 2 Previous Next 15 Replies Latest reply on Oct 23, 2018 9:42 PM by Anuj Vaijapurkar

# Issue with the length of bars in Bar Chart

Hi,

Please see below image. 29% bar is taller than 39% bar. 37% bar is much taller than 39% bar.

Not sure what am I doing wrong.

• ###### 1. Re: Issue with the length of bars in Bar Chart

Hi Anuj ,

Have you calculated these Fields "30mins-1hour" and "over 2 hours" ? if you've calculated then there's something wrong with your calculations.

Thanks

Kashish

• ###### 2. Re: Issue with the length of bars in Bar Chart

Else share some sample mock up in packaged workbook.

Mahfooj

• ###### 3. Re: Issue with the length of bars in Bar Chart

No Kashish, it's not a calculated field. It's just a question with the answers as "1-2 hours", "Over 2 hours" with the year.

• ###### 4. Re: Issue with the length of bars in Bar Chart

Oops! How do I do that, Mahfooj?

• ###### 5. Re: Issue with the length of bars in Bar Chart

Double click on the axis of your measure which you've used in your view then take a look at all these highlighted sections

If axis seems fine and still having same issue then I'd recommend you to share the sample workbook.

• ###### 6. Re: Issue with the length of bars in Bar Chart

Please check the label mark. Check if you are displaying the correct value or not. Sometimes you display some other measure on the graph but by mistake put different measure value on the labels mark

• ###### 7. Re: Issue with the length of bars in Bar Chart

Yeah! This is a good point.

• ###### 8. Re: Issue with the length of bars in Bar Chart

I think I am not using "Compute Using" correctly and that's the reason.

I have attached the Tableau package and the CSV file.

I'm calculating the Male - Female % for each year. The sum of % should be 100% for each year for them. Here, the sum is 100% but the bar length is thrown out of the window. 50% bar is lengthier than 53% bar in Female section.

• ###### 9. Re: Issue with the length of bars in Bar Chart

In this case it should be compute using Year instead of Gender.

That will fix the table calculation on table labels but if you want the same to be affect the size of the bar then you need to apply the same table calculation in column shelf measure.

Let us know if this help.

Mahfooj

• ###### 10. Re: Issue with the length of bars in Bar Chart

I had tried this one too. It fixes the bar length issue but then the total % goes wrong. If you see the total % of Male and Female for each year isn't 100%.

2012: 16% + 17% = 33%

2014: 29% + 33% = 62%

2016: 26% + 27% = 53%

2018: 28% + 23% = 51%

• ###### 11. Re: Issue with the length of bars in Bar Chart

You mean to say this,

Best would be this one, just use gender dimension on color and set the table calculation as per screenshot.

Hope this will help.

Mahfooj

1 of 1 people found this helpful
• ###### 12. Re: Issue with the length of bars in Bar Chart

Hi Anuj,

I've looked into your workbook. Is this supposed to be look like this?

What I notice, the length of the bar is the SUM(number of records) and the labels are percentage of it. As for the percentage, you are calculating it based on gender by years.

Try to drag SUM(number of records) to the label too. You will see why the length and the percentage doesn't show how it supposed to be.

• ###### 13. Re: Issue with the length of bars in Bar Chart

Hi Anuj,

Forget to mention, the reason why 50% bar is longer than 53%, it's because the bar shows the number of records while the labels show the percentage of male & female for each year. You have to change the SUM(Number of Records) in the Columns shelf to the same % of SUM(Number of Records) in the Labels mark card

Regards,

Shahirah

2 of 2 people found this helpful
• ###### 14. Re: Issue with the length of bars in Bar Chart

WOW! Thanks Shahirah! This worked exactly as expected.

Million thanks!

1 2 Previous Next