9 Replies Latest reply on Jul 20, 2016 3:49 PM by Derek Wong

# Grand total and percentage columns

Hi all,

Newbie here. I've searched the knowledge base and the forums for various answers on determining percentage of totals, but still haven't managed to figure out how to make the chart look like I want it to.

Its this simple:

 Month Car Truck Total % Car Jan 644674 26250 670924 96% Feb 636847 22854 659701 97% Mar 761938 24055 785993 97% Apr 750811 24227 775038 97% May 801900 29160 831060 96% Jun 795046 25146 820192 97% Jul 922739 29931 952670 97% Aug 955878 28948 984826 97% Sep 782187 28221 810408 97% Oct 704588 26520 731108 96% Nov 671729 25882 697611 96% Dec 713389 24070 737459 97%

Yet apparently I can't figure it out.   I've tried adding a grand total from the Analysis-Totals option but can't figure out how to also make a percentage next to it. I've also created a measure totals using:  for window_sum(sum([Volume])).  But I can't make that next jump to having a simple percentage column showing the percent of ONE of my modes (car, not truck).

Apologies for repeating a  commonly asked question, but after 2 hours of reading community posts I'm still no closer. Thanks for any help!

Melissa

• ###### 1. Re: Grand total and percentage columns

Melissa,

I was able to create a mock up in Tableau from the data you described-- take a look at the calculation I used for % car. This assumes that your data is set up such that the car and truck numbers are separate measures. If your data is organized differently, it might help to upload a packaged workbook so we can take a look.

• ###### 2. Re: Grand total and percentage columns

Yeah, the only problem is that both Car and Truck are dimensions of "Volume" (the measure). Is there a way to separate out the volume labeled "Car" in this instance?

(I need to confirm I can share the data before I can attach it, sorry! )

Melissa

• ###### 3. Re: Grand total and percentage columns

OK. I'm assuming there's a "type" dimension that categorizes if the volume belongs to car or truck? In that case, you'll just have to do one more step.

Here's one way to do it: separate this volume out in calculated fields. For example, to capture just Car volume, you could create a Calculated Field like so:

IF [Type]="Car" Then [Volume]

END

and then a second one for truck volume :

IF [Type]="Truck" Then [Volume]

END

Then you'll have two new fields that you can use to make the calculation in my first reply.

• ###### 4. Re: Grand total and percentage columns

This helps me in SO MANY WAYS. I've been struggling to figure out the syntax for simply separating out one dimension type from another so hopefully this will do the trick!

Okay I'm able to attach the actual workbook. See attached, sheet titled "MONTHLY Chart." In this instance I'm breaking out Cars and NEXUS. I've gone ahead and used your example to create separate measures by "mode" (Car, NEXUS, Truck). But I can't get it to have nice columns like yours. What's the best order of dragging pills to the table to make it look as good as your example?

Thank you so much for your help!!

Melissa

• ###### 5. Re: Grand total and percentage columns

Melissa,

If you add "Measure Values" to Text, and add Car/Nexus to that, and then drop Measure Names on columns, this should do exactly what you want. Take a look at the screenshot below and let me know if you're able to replicate it.

1 of 1 people found this helpful
• ###### 6. Re: Grand total and percentage columns

Awesome, I didn't even know what those "measure values" and measure "names" were for. So much to learn! Anyway I got it all figured except for the formatting of my NEXUS percentage. What do you think I'm doing wrong here with that NEXUS % number?

• ###### 7. Re: Grand total and percentage columns

All you have to do is find the calculation in the measures tab on the left, right click > Default Properties > Number Format > Percentage

Select the number of decimal points and it'll show the correct data

1 of 1 people found this helpful
• ###### 8. Re: Grand total and percentage columns

THANK YOU!! Its beautiful now. Much appreciated.

• ###### 9. Re: Grand total and percentage columns

No problem! Glad I was able to assist a fellow Tableau user