# In Pivot table Why is the percentage calculated field is summed in the subtotal?

**URL:** <https://community.amazonquick.com/t/in-pivot-table-why-is-the-percentage-calculated-field-is-summed-in-the-subtotal/12369>\
**Category:** Q&A\
**Tags:** calculations, quick-sight\
**Created:** [April 18, 2023, 11:58am UTC](https://community.amazonquick.com/t/in-pivot-table-why-is-the-percentage-calculated-field-is-summed-in-the-subtotal/12369 "2023-04-18T11:58:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali\_B](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Ali\_B](https://community.amazonquick.com/u/Ali_B)\
**Post date:** [April 18, 2023, 11:58am UTC](https://community.amazonquick.com/t/in-pivot-table-why-is-the-percentage-calculated-field-is-summed-in-the-subtotal/12369/1 "2023-04-18T11:58:09Z")

</div>

![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/5/52e38f77e2e901103f3e29f3add5e0c29c668d31.png)

I was expecting it to be calculated similarly to the rest of the lines. Theoretical Staff Time (Total)/Actual Staff Time (Total)

here are the expressions involved:

```auto
Staff Efficiency (%):
{Theoritical Staff Time}/{Actual Staff Time}

Actual Staff Time:
sum({ACTUAL_RSRC_USAGE},[{BATCH_ID},{Product Code}])

Theoretical Staff Time:
 (({Planned Usage}*1000)/{Planned Resource Qty (Routing UOM)})*({FG (Routing UOM)})/1000

Planned Usage:
sum({PLAN_RSRC_USAGE},[{BATCH_ID},{Product Code}])

Planned Resource Qty (Routing UOM):
sum({PLAN_RSRC_QTY_ROUTING_UOM},[{BATCH_ID},{Product Code}])

FG(Routing UOM):
sum({ACTUAL_QTY_IN_ROUTING_UOM},[{BATCH_ID},{Product Code}]) 

```

---

<div class="post-metadata">

**Author:** ![Ali\_B](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Ali\_B](https://community.amazonquick.com/u/Ali_B)\
**Post date:** [April 18, 2023, 12:20pm UTC](https://community.amazonquick.com/t/in-pivot-table-why-is-the-percentage-calculated-field-is-summed-in-the-subtotal/12369/2 "2023-04-18T12:20:17Z")

</div>

OK, I got the issue,

from the Field Wells, I have changed the aggregation type to Average.

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

---

<div class="post-metadata">

**Author:** ![heraclitus](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@heraclitus](https://community.amazonquick.com/u/heraclitus)\
**Post date:** [May 10, 2023, 8:10pm UTC](https://community.amazonquick.com/t/in-pivot-table-why-is-the-percentage-calculated-field-is-summed-in-the-subtotal/12369/3 "2023-05-10T20:10:51Z")

</div>

Changing the aggregation to Average averages the individual percentages. It does not equate to sum(Theoretical)/sum(Actual), which is what I would expect that most people want in their subtotal display.
