10 Replies Latest reply on Apr 24, 2015 9:21 AM by Alexander Mou

# How to add total sample size on Pie Chart

Hello there!

Does anyone know how to add the total sample size on pie chart? I have a very simple pie chart, one slice for 5, the other slice for 7. So I want to add 5+7=12 on the pie chart. Is there any easy way to do this?

• ###### 1. Re: How to add total sample size on Pie Chart

Hi. You can try using the total function. Create a calculated field: Total(sum(measure)).  You can then drop this on to the label mark. Or you can pull it onto detail so you can access it elsewhere, for instance in the title.

• ###### 2. Re: How to add total sample size on Pie Chart

Dear Ram,

Thanks so much for your reply. The problem with this is that I have several pies in one report and there is no good way to add this sample size to each pie. It looks like this:

What I want to do ideally is to be able to add 258+244 = 502 in FY12 School of Engineering Pie and so on.

• ###### 3. Re: How to add total sample size on Pie Chart

Ok, I understand what you're trying to do now. I've attached a workbook that accomplishes this. It is based on this link from drawing with numbers. I don't know an easy alternative; maybe overlaying some floating worksheet but that is a workaround too.

http://drawingwithnumbers.artisart.org/older-but-still-useful-conditional-formatting/

1 of 1 people found this helpful
• ###### 4. Re: How to add total sample size on Pie Chart

Try Donut Chart

http://vizdiff.blogspot.com/2014/12/showing-partial-progress-with-donut.html

You can put the total in the middle.

On Thu, Apr 23, 2015 at 1:32 PM, Ram Kanteti <

• ###### 5. Re: How to add total sample size on Pie Chart

Ram, I really appreciate your help. It will take a long time for me to figure this out since it's a way out of my head!

• ###### 6. Re: How to add total sample size on Pie Chart

No problem; I can explain a bit more. For the construction of it, it is basically using a trick of creating new headers with a fake calculation of 0.0. This allows you to basically bump together different types of charts. Like if you wanted to add a sparkline to a table.

You make two of these (column and 0), make the first one invisible, dual axis to overlap for each element and create your element on the '0' column. One element is the pie chart and another is the total.

The total is just the sum by each school placed the text marks of a '0' column. Hope that helps a bit but going through the original link is very useful. Good luck.

• ###### 7. Re: How to add total sample size on Pie Chart

here is an alternative solution

https://public.tableau.com/views/DonutChart_2/Dashboard1?:embed=y&:showTabs=y&:display_count=yes

On Thu, Apr 23, 2015 at 2:08 PM, Ram Kanteti <

• ###### 8. Re: How to add total sample size on Pie Chart

hi Elle,

want to add total in middle of pie chart.

Create one dummy calc

title:  one

value: 1

drag this calc into two time in column shelf and un check aggregation in analysis.

hide field labels.

no we get dual axis data. so change second pie as circular and create total(sum(sales)) into text.

refer

http://community.tableau.com/people/sankar.rajan/blog/2015/04/10/how-to-make-kpi-donut-charts

thanks

sankar

1 of 1 people found this helpful
• ###### 9. Re: How to add total sample size on Pie Chart

This worked like a charm and it was so easy! Thanks so much!!!!

• ###### 10. Re: How to add total sample size on Pie Chart

So glad that you are able to replicate it!

On Fri, Apr 24, 2015 at 7:35 AM, ELLE RISTOW <