4 Replies Latest reply on Mar 27, 2017 2:07 PM by Glenn Kuly

# How do I show a subtotal on a Pie Graph

Hello! I searched the forum but wasn't able to find anything on this topic.

I'd like to display the green section subtotal somehow (title would be perfect..but not having luck with that).

It should show "67% On Time" (18.7 + 20.7+ 27.6)

Options I've tried:

1. Calculated Field - adding to details - displaying in title comes up as 161 to 238...sigh

2. Creating another table and displaying it separately on my dashboard - It worked...but looked horrible and took up way to much of my dashboard.

Option 1 would be my 1st choice, but if there are some tips on how I could do Option 2...that would be great.

Help! Thanks! (I've spent a week on this! Ugh!)

• ###### 1. Re: How do I show a subtotal on a Pie Graph

You probably want to look at: WINDOW_SUM( if (whatever makes a slice green) then SUM([whatever measure you're using]) END  )

Posting a sample workbook would really help here, because then I could have proved out the syntax and made sure the table calc setting was right.  Without a workbook, I expect a dozen more cycles before we work out the exact syntax t use here.  And we might be able to do this with LODs as well.

• ###### 2. Re: How do I show a subtotal on a Pie Graph

I've got some procrastination time this afternoon, so I threw together a donut chart with a subtotal in the middle (I've been doing some visualizations along these lines for a work project):

Here a Tableau page on Donut Chart Creation: Creating Doughnut Charts | Tableau Software

I've used a very simple calculated field for the subtotal, a more sophisticated approach opens up a lot of possibilities. Where this kind of viz can get really cool is if you create a parameter for different 'slice' sub-groupings (wish I had enough procrastination time to develop this for you).

-- Glenn

• ###### 3. Re: How do I show a subtotal on a Pie Graph

Thanks Glenn! Awesome simple solution!

Quick Follow up: I don't quite understand why "Minimum" is selected under the calculation.

"

1. On Rows, right-click both instances of Number of Records, and then select Measure(Sum) > Minimum."

Thanks so much! You made my day!

• ###### 4. Re: How do I show a subtotal on a Pie Graph

My pleasure Michael.

I know that setting the Number of Records to Minimum has something to do with aligning slices and the inner circle properly, but I don't know how or why it does this. Max, Avg, CountD work as well. I believe it has something to do with setting up a common basis for a dual axis chart.

-- Glenn