3 Replies Latest reply on Nov 5, 2018 8:27 AM by Sean Wong

Stacked Chart - % of Total By Year

Hi All,

I have a query regarding how Tableau calculates the % on stacked chart, please refer to the below link:

On my chart named 'hires by year', it shows the breakdown of Male and Female employees hired by year. Instead of displaying values, I have selected % of Total and they are displaying correctly (refer to the % in column 5 and 6 in the image)

On my second chart named 'total by year', I have done a running total to calculate the number of employees by year. However, the % of total is exactly the same as the first chart.

Since I am reporting the total employees, I want the breakdown in % based on total employees, not based on the # of M/F hires in that year.

Could you please let me know how I can get the highlighted % on my graph?

Thanks!!

• 1. Re: Stacked Chart - % of Total By Year

good morning

is this the chart you expected

first I converted your year into a real date (it is a number)

next the running total formula is

calculated as

then the percent of total no the total running

calculated as

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• 2. Re: Stacked Chart - % of Total By Year

Apologies for the late reply. Thanks for the above but the female % on your graph seems to be too high.

What I want to show is the below:

Eg. Year 2002 I have a total of 149,655 employees with 59,579 Female and 90,076 Male; I would expect the % on the graph to show 60.2% (90,076/149,655)

• 3. Re: Stacked Chart - % of Total By Year

Hi all,

Just to clarify, I want to show the total employees by gender % for ever year.

Thanks!