5 Replies Latest reply on Feb 16, 2016 9:52 AM by Rody Zakovich

# How to show two aggregate values in a Donut Chart separated by a "IF" sentence?

Hi, everyone.

Currently, I have a donut chart separated by a "IF" sentence, which mainly is used to separate the donut chart by two parts with two colors. I marked those two parts as "Achieved" and "Not Achieved".

I want to see two specific percentage numbers in those two parts. My idea is build up another "IF" sentence based on "Achieved" and "Not Achieved" to show those two percentage numbers.

However, Tableau does not allow me to put aggregate value into "IF" sentence. Those two percentage numbers are called "Percentage Achieved" and "Percentage to Goal".

Now my question is: Can I use some ways to combine "Percentage Achieved" and "Percentage to Goal" together with showing them in different color and sizes based on their value?

The picture shown below is what it looks like right now:

Currently there is no dimension added because I will use it to separate different time period later. Therefore, I wonder can I use "FIXED" to do that?

Can anybody give me some ideas on how to solve my problem? Any tips will be appreciated.

Thank you all in advance.

Sincerely

Tianyi Zhou

• ###### 1. Re: How to show two aggregate values in a Donut Chart separated by a "IF" sentence?

Drag the Number of Records field, drop it on "Text" marks shelf then right click on that then add the table Calculation, select "Percentage of Total".

Now Report will show % of total in textual format.

EX:

1) Drag the Number of Records field onto Work Area, then add the any Dimension ([Status]) to colors mark shelf, it will divide the total no. of records in to different colors as per the Dimension place on the view.

2) Dragged the Sales onto text shelf then sales will be divided into different groups as per the dimension placed in the previous step.

3) Right click on the [Sales] on the work area then click on "Add Quick Table Calculations" then select "Percentage of total".

Best Regards

Kumar

• ###### 2. Re: How to show two aggregate values in a Donut Chart separated by a "IF" sentence?

Hello Tianyi,

Just wanted to drop a useful link for you on how to create Donut Charts (With Text) in Tableau.

Tableau Tip: How to make KPI donut charts

The suggestions the Kumar gave should get you to the intended result, but if you still have trouble, let us know.

Best regards,

Rody

• ###### 3. Re: How to show two aggregate values in a Donut Chart separated by a "IF" sentence?

Hi, Kumar.

Thank you for your response.

I am sorry to tell you, although your solution can not work, it did give me some useful hints about how to solve my problem.

In fact, after I finish making a ring, I directly drag all the measure values into "Angle" and "Size" and remove all the things I do not want.

Then I make it.

Thank you again for your help.

Sincerely

Tianyi Zhou

• ###### 4. Re: How to show two aggregate values in a Donut Chart separated by a "IF" sentence?

Hi, Rody.

I really appreciate your help for sending me the link. In fact, the content in your link also contributed to my final success in creating my "Donuts".

Thank you again for your prompt response.

Sincerely

Tianyi Zhou

• ###### 5. Re: How to show two aggregate values in a Donut Chart separated by a "IF" sentence?

Hello Tianyi,

Awesome! Were you able to get to your solution? Or do you still have additional questions?

Let me know.

Regards,

Rody