4 Replies Latest reply on Jun 24, 2018 3:20 PM by Peter Fakan

# Making a pie chart with a binary variable

Hi, I'm fairly new to using Tableau but for the life of me cannot figure this out problem out.

If I have a variable for example that is a 1 when it rains and a 0 on days it doesn't rain, and I want to make a simple pie chart showing the average of this, how would I go about doing this?

I may be overthinking this but I'm not quite sure why I can't get it to work, any help is greatly appreciated!

• ###### 1. Re: Making a pie chart with a binary variable

Hi Yosef,

Pl post a sample workbook.

~Tushar

• ###### 2. Re: Making a pie chart with a binary variable

Hi Yosef,

Welcome to the community!

There are some web links that describe how to do it.

Build a Pie Chart

https://www.interworks.com/blog/ccapitula/2014/09/26/tableau-essentials-chart-types-pie-chart

Just Google for "Tableau Pie Chart"

You'll get so many different links with examples.

Let us know if this help. Else share some sample mock up data.

Mahfooj

• ###### 3. Re: Making a pie chart with a binary variable

I attached a sample workbook here.

Like I said all I need is a pie chart of the percentage of time it occurs but I can't seem to figure it out or find videos similar to this.

• ###### 4. Re: Making a pie chart with a binary variable

Hi Yosef,

Like this ?

I started with a calculated field to unpack the 0 and 1 into a dimension, then dropped this onto the colour shelf

And then I changed the measure into a percent of total calculation using the quick table calculations menu

HTH 18.1 attached

Peter