2 Replies Latest reply on Mar 15, 2017 3:39 AM by Larissa Moniz

# Creating graphs with filters that calculate percentage of total

I have what I think should be a simple problem to resolve. I'm trying to create a graph in Tableau for survey data (sample workbook attached). I am trying to make each question a filter and would like to express answers as a percentage of the total number of respondants in that column.

For example in the first tab ("Raw numbers"): you can see that there are 31 respondants from the East midlands. And if in Q1 you filter on no there are13 respondants and if you filter on yes there are 18 respondants. This means that in the East midlands, roughly 42% (13/31) of respondents responded no and 58% (18/31) responded yes.

I would like the graph to be expressed in these terms: If I select all answers for Q1, the East Midlands bar (and all other bars) would be at 100%, if I clicked No it would be 42% and if I clicked yes it would be 58%. However when I have had no luck creating this in the "Percentages" tab.

I have tried to express the data as a percentage of the table but this expresses data relative to the other regions (so the whole graph values always = 100%). I've also expressed it as a percentage of the column so that all values start at 100% when all data is selected. But if I filter (i.e just for no's) the data is then expressed as a percentage of just the filtered data so the graph is always 100%.

I know that I could add colour/size to show the breakdown of yes/no answers, but since I have multiple questions with different answers (some are yes, no, some have more answers) this isn't a good solution.

If anyone has a suggestion it would be much appreciated-I feel like the solution should be simple but I'm struggling!

Thanks,

Larissa

• ###### 1. Re: Creating graphs with filters that calculate percentage of total

Hi Larissa

This is FAQ and you first need to pivot data to handle these data.\

Rest of steps are easy I think.

Thanks,

Shin

• ###### 2. Re: Creating graphs with filters that calculate percentage of total

Thank you for your suggestion. It is close-as in I can now display as percentages. However, I can only look at eqch question individually. I would like to be able to filter on multple questions at one time (i.e see for people who answered no in Q1 how many answered No (or Yes)).

Is there a way to have filters for the no/yes answers within each question filter?

Larissa