6 Replies Latest reply on Apr 19, 2018 4:07 PM by natun barosh

# Creating a 100% stacked bar chart with 2 measure values

Hi everyone,

I'm stuck trying to convert a stack bar with 2 measure values from an absolute values bar chart to a 100% bar chart. I'd really appreciate any advice here.

Thank you!

PS: I'm using last version available of Tableau

Dani • ###### 1. Re: Creating a 100% stacked bar chart with 2 measure values

My best guess would be to create two new calculated fields:

SUM([Confirmed Auto])/(SUM([Confirmed Auto)+SUM([Confirmed Imported]))

and

SUM([Confirmed Imported])/(SUM([Confirmed Auto)+SUM([Confirmed Imported]))

Then use these in the Measure Names card instead.

2 of 2 people found this helpful
• ###### 2. Re: Creating a 100% stacked bar chart with 2 measure values

You are trying to show 2 measures as a percentage of the sum of the 2 measures.

This is not achievable via a built in function of tableau.

You will need to create a calculated field total measure  -->  measure1 + measure 2

then 2 more calculated fields measure 1/ total measure

and measure 2 / total measure

this will give you the percentage values you would like to plot.

If you need further help please share a sample workbook and i can demonstrate the method i described.

1 of 1 people found this helpful
• ###### 3. Re: Creating a 100% stacked bar chart with 2 measure values

That's the correct method Benjamin.

I was just too slow to answer

Keep up the good work.

• ###### 4. Re: Creating a 100% stacked bar chart with 2 measure values

Thank you so much Khalid! I'll try it to see how it goes.

Dani

• ###### 5. Re: Creating a 100% stacked bar chart with 2 measure values

Thank you Benjamin! It helps a lot.

Dani

• ###### 6. Re: Creating a 100% stacked bar chart with 2 measure values

hey benjamin,

i used your method  and it work fine. i do have one question regarding this method:  how do i show the label of the original value (meaning the one i used to create the calculated field)?

thanks,
natun barosh