# How to achieve 100% in Subtotals when having 3 or more Dimensions in the Pivot table

**URL:** <https://community.amazonquick.com/t/how-to-achieve-100-in-subtotals-when-having-3-or-more-dimensions-in-the-pivot-table/32289>\
**Category:** Q&A\
**Tags:** calculations, Business-Intelligence-Engineer, quick-sight\
**Created:** [July 8, 2024, 3:21pm UTC](https://community.amazonquick.com/t/how-to-achieve-100-in-subtotals-when-having-3-or-more-dimensions-in-the-pivot-table/32289 "2024-07-08T15:21:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chabbils](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/chabbils/32/7707_2.png) [@chabbils](https://community.amazonquick.com/u/chabbils)\
**Post date:** [July 8, 2024, 3:21pm UTC](https://community.amazonquick.com/t/how-to-achieve-100-in-subtotals-when-having-3-or-more-dimensions-in-the-pivot-table/32289/1 "2024-07-08T15:21:43Z")

</div>

Hi all,

I have 2 dimensions in the first visual and am able to get 100% in Subtotals using Table Calculation as “Percent of Total” and Calcuate as “Group Down” but it’s not working in the second visual which has 3 dimensions. I tried all “Calculate as” options i.e. Table Down, Group Down, Group Down across etc. but am not able to get 100% in Subtotals. Can you please tell me how can I achieve it?

 ![Screenshot 2024-07-08 at 17.13.27](https://d1wl4jav5dp96l.cloudfront.net/original/3X/f/a/fa2870280c47baf0c920d27fc26bbe25448d34d6.png)

 ![Screenshot 2024-07-08 at 17.09.50](https://d1wl4jav5dp96l.cloudfront.net/original/3X/2/b/2bf702097fb2267ad67f6746bfe809b919de96ad.png)

Thanks

---

<div class="post-metadata">

**Author:** ![Thomas](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/thomas/32/3624_2.png) [@Thomas](https://community.amazonquick.com/u/Thomas)\
**Post date:** [July 9, 2024, 12:00pm UTC](https://community.amazonquick.com/t/how-to-achieve-100-in-subtotals-when-having-3-or-more-dimensions-in-the-pivot-table/32289/2 "2024-07-09T12:00:49Z")

</div>

Hi @chabbils,  
You can achieve your desired behavior by using the [percentOfTotal](https://docs.aws.amazon.com/quicksight/latest/user/percentOfTotal-function.html) function in a calculated field.  
Simply add all dimensions that you use in your rows and columns, except the lowest level of the rows, into the _partition field_ of the function. The result should look similar to the following expression:

```auto
percentOfTotal(sum({Number of Customer Column}),[{Gifting Experience},{Age Band}, {Date Column}])

```

To get it now formatted as percentage , you simply adjust the _Show as_ property of the value to _Percent_  
 ![Screenshot 2024-07-09 at 13.56.51](https://d1wl4jav5dp96l.cloudfront.net/original/3X/2/e/2e34da284ae5802950021e945145008e6c378aa7.png)

The final result will look then similar (as I used different dimensions) to the following:  
 ![Screenshot 2024-07-09 at 13.57.56](https://d1wl4jav5dp96l.cloudfront.net/original/3X/b/d/bd501263be4ab31f9c6743334dddc7acf78eb488.png)

Did this answer your question? If so, please help the community out by marking this answer as "Solution!
