# Miscalculation of percentages, Donut Chart visualization

**URL:** <https://community.amazonquick.com/t/miscalculation-of-percentages-donut-chart-visualization/10698>\
**Category:** Q&A\
**Tags:** calculations, quick-sight\
**Created:** [March 6, 2023, 9:02am UTC](https://community.amazonquick.com/t/miscalculation-of-percentages-donut-chart-visualization/10698 "2023-03-06T09:02:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian\_Soerup](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/christian_soerup/32/6827_2.png) [@Christian\_Soerup](https://community.amazonquick.com/u/Christian_Soerup)\
**Post date:** [March 6, 2023, 9:02am UTC](https://community.amazonquick.com/t/miscalculation-of-percentages-donut-chart-visualization/10698/1 "2023-03-06T09:02:35Z")

</div>

I have a donut chart in which I would like to display both values and percentages. However, when applying percentages the numbers don’t add up.

In the demonstration video found here ([Using donut charts - Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/user/donut-chart.html)), we see a demo various minerals distributed by sales. The total sales equals $36,755K. Adding values and percentages gives, for Iron Ore, 13,378 and 36%. The 36% of 36,755 equals 13,231 … not 13,378. I suspect Quick Sight for miscalculating the percentages. Can you confirm?

---

<div class="post-metadata">

**Author:** ![Biswajit\_1993](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/biswajit_1993/32/20472_2.png) [@Biswajit\_1993](https://community.amazonquick.com/u/Biswajit_1993)\
**Post date:** [March 6, 2023, 9:29am UTC](https://community.amazonquick.com/t/miscalculation-of-percentages-donut-chart-visualization/10698/2 "2023-03-06T09:29:43Z")

</div>

Hi @Christian_Soerup , nothing like than we can add both numbers and percentage in the donut chart in Quick Sight.

Please need follow some steps to achieve the required results.

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/a/a57ca2268994a8fa98c42e0bf38b0d2186569eb3.png)  
If you see the above picture I have the donut chart and added both the number and percentage for this chart.

Step -1  
Go to format visuals .

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/6/6b8f8d0135c2b6f263df3324196940bd1fca325a.png)  
Step -2  
Go to **Data Labels** dropdown menu from the left sides & select the **Metric label style** as **value & percent.**

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/d/d94224f1162c7ac412f613621d910b0914917d54.png)

---

<div class="post-metadata">

**Author:** ![Christian\_Soerup](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/christian_soerup/32/6827_2.png) [@Christian\_Soerup](https://community.amazonquick.com/u/Christian_Soerup)\
**Post date:** [March 6, 2023, 9:37am UTC](https://community.amazonquick.com/t/miscalculation-of-percentages-donut-chart-visualization/10698/3 "2023-03-06T09:37:06Z")

</div>

Hi @Biswajit_1993 ,  
Thanks for your reply. I have done exactly as you suggest. Here’s the example where there is a mismatch between values and percentages:

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/4/420af4725648dfcd5cf221d886526fe6afb4daaf.jpeg)

---

<div class="post-metadata">

**Author:** ![Biswajit\_1993](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/biswajit_1993/32/20472_2.png) [@Biswajit\_1993](https://community.amazonquick.com/u/Biswajit_1993)\
**Post date:** [March 6, 2023, 10:29am UTC](https://community.amazonquick.com/t/miscalculation-of-percentages-donut-chart-visualization/10698/4 "2023-03-06T10:29:26Z")

</div>

hi @Christian_Soerup I think the value & percentage both are correct if you required decimal point instead of round number we can do that but the percentage is ok if you see dividing with the respective category value with total value then we got the same percentage.

---

<div class="post-metadata">

**Author:** ![Christian\_Soerup](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/christian_soerup/32/6827_2.png) [@Christian\_Soerup](https://community.amazonquick.com/u/Christian_Soerup)\
**Post date:** [March 6, 2023, 10:42am UTC](https://community.amazonquick.com/t/miscalculation-of-percentages-donut-chart-visualization/10698/5 "2023-03-06T10:42:07Z")

</div>

I’m glad that we agree on the method and I do see your point about the rounding of numbers. Here’s a different example where the percentages are off. For the largest ‘piece’, the numbers are 17,652 divided by 38,213. That gives me about 46% and not 39%. Agree?

![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/6/675ea25b2b762c423bc6570cc7e565a033102577.png)

---

<div class="post-metadata">

**Author:** ![Biswajit\_1993](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/biswajit_1993/32/20472_2.png) [@Biswajit\_1993](https://community.amazonquick.com/u/Biswajit_1993)\
**Post date:** [March 6, 2023, 11:24am UTC](https://community.amazonquick.com/t/miscalculation-of-percentages-donut-chart-visualization/10698/6 "2023-03-06T11:24:20Z")

</div>

Hi @Christian_Soerup Thanx for your detailed query. I think in this case some data issues at your end nothing to do with Quick Sight.  
Can you check once with your data source level.

---

<div class="post-metadata">

**Author:** ![Koushik\_Muthanna](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/koushik_muthanna/32/3290_2.png) [@Koushik\_Muthanna](https://community.amazonquick.com/u/Koushik_Muthanna)\
**Post date:** [March 6, 2023, 12:32pm UTC](https://community.amazonquick.com/t/miscalculation-of-percentages-donut-chart-visualization/10698/7 "2023-03-06T12:32:26Z")

</div>

Hi @Christian_Soerup ,

You can also validate the % calculation using a pivot table. Below is a screenshot

In Pivot table, I am using a table calculation **Percent of total** ( [Functions for pivot table calculations - Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/user/supported-functions.html) ) with the calculation being **Table Down** ( [Ways to apply pivot table calculations - Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/user/supported-applications.html) )

 ![Screenshot 2023-03-06 at 13.30.42](https://d1wl4jav5dp96l.cloudfront.net/original/2X/b/b3719c0208bfb653b8cc2eccb804ea358ccdf66b.png)

Kind regards,  
Koushik

---

<div class="post-metadata">

**Author:** ![Christian\_Soerup](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/christian_soerup/32/6827_2.png) [@Christian\_Soerup](https://community.amazonquick.com/u/Christian_Soerup)\
**Post date:** [March 6, 2023, 12:34pm UTC](https://community.amazonquick.com/t/miscalculation-of-percentages-donut-chart-visualization/10698/8 "2023-03-06T12:34:15Z")

</div>

I’ll do a check and get back to this thread. Thanks for your help, @Biswajit_1993 and @Koushik_Muthanna
