1
votes

I am new to Tableau and I have created a crosstab that shows a count of items per type. I want to add a column to my table. I need to know the percentage of the whole - I looked up a couple of things but I can't seem to find this exact problem.

Type       |Count      |% of Whole
-----------------------------------
A          |10         |1%
B          |99         |9.9%
C          |256        |25.6%
D          |300        |30%
E          |335        |33.5%

After reading some I think my issue is that I am not sure how to derive a calculation that is going to give a TOTAL # of Types. In Excel I would take the row value divided by the sum of all rows. Additionally I am fairly certain that this will lead to an issue once I filter this table - not sure I know how to preserve the percentages with filters.

I am using Tableau 9.2. Thanks in advance for any help.

1

1 Answers

0
votes

You can create the following calculated field:

SUM([Count])/TOTAL(SUM([Count]))

TOTAL takes into consideration all values of your variable.

Alternatively, you can use quick table calculation by right-clicking on count (here I'm using an example from the Superstore dataset):

enter image description here