# Problems plotting an average calculated with sumOver

**URL:** <https://community.amazonquick.com/t/problems-plotting-an-average-calculated-with-sumover/29671>\
**Category:** Q&A\
**Tags:** analysis, calculated-field, calculation, formulas, calculations, visuals, calculations-editor, Business-Intelligence-Engineer, quick-sight\
**Created:** [May 10, 2024, 8:10pm UTC](https://community.amazonquick.com/t/problems-plotting-an-average-calculated-with-sumover/29671 "2024-05-10T20:10:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![manromero](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@manromero](https://community.amazonquick.com/u/manromero)\
**Post date:** [May 10, 2024, 8:10pm UTC](https://community.amazonquick.com/t/problems-plotting-an-average-calculated-with-sumover/29671/1 "2024-05-10T20:10:29Z")

</div>

I am trying to calculate an average for 3 variables: **cosecha** , **altura** and **categoría** (which in this example will be product).  
I calculated the indicator by which we will do the average which is something like this:  
**IM 30 - cosecha – categoría** = sumIf({saldo\_total\_capital},{estado\_credito} = ‘CASTIGADO’ AND {numero\_dias\_mora} \> 30 )/sumOver(sumIf({valor\_desembolso},Altura=0),[Cosecha, {producto}])

Then I take the average like this:  
**IM 30 prom - cosecha – categoría** = avgOver({IM 30 - cosecha - categoría}, [Altura,{producto}])

Graphically it looks something like this:

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/0/0/004be3f0f61b38ccdca6ebeb9490d13ffe61f593.png)

Now, I need to plot only this average by Height and Product but removing the variable cosecha damages the graph:

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/d/7/d7f192df08162bb9d02e59b8942203c0404a3a89.png)

The question here is, is it possible to do what I need, how should I do the calculations to plot the average and get the expected graph?, something like this:

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/e/4/e4bcd61a44aa498dc15235a1bcd1d547e9fd9326.png)

---

<div class="post-metadata">

**Author:** ![WLS-D](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/wls-d/32/36109_2.png) [@WLS-D](https://community.amazonquick.com/u/WLS-D)\
**Post date:** [May 10, 2024, 9:45pm UTC](https://community.amazonquick.com/t/problems-plotting-an-average-calculated-with-sumover/29671/2 "2024-05-10T21:45:43Z")

</div>

Hello @manromero , welcome to the Quick Sight community!

That error happens because you are missing fields that the visualization relies on. One suggestion I have here is do you need to have every attribute in your calculated fields or can someone them be filters instead?

---

<div class="post-metadata">

**Author:** ![manromero](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@manromero](https://community.amazonquick.com/u/manromero)\
**Post date:** [May 10, 2024, 11:18pm UTC](https://community.amazonquick.com/t/problems-plotting-an-average-calculated-with-sumover/29671/3 "2024-05-10T23:18:14Z")

</div>

Thank you very much @WLS-D !

I don’t understand your question very well but to be clearer, what I need is to get the calculated field **IM 30 Average** based on **Altura** , **Producto** and **Cosecha** but when plotting, I only need the variables **Altura** , **Producto** and the calculated field **IM 30 Average** excluding **Cosecha**. I know that when removing the **Cosecha** field from the visual object the error occurs, but is there any way to solve this?

---

<div class="post-metadata">

**Author:** ![Xclipse](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/xclipse/32/20455_2.png) [@Xclipse](https://community.amazonquick.com/u/Xclipse)\
**Post date:** [June 1, 2024, 4:23am UTC](https://community.amazonquick.com/t/problems-plotting-an-average-calculated-with-sumover/29671/4 "2024-06-01T04:23:23Z")

</div>

Hi @manromero, in case you need further assistance with your problem, please create a sample dashboard with sample dataset showing your problem state using Arena and please create a new post, so we can look at it from a fresh perspective. (Details on using Arena can be found here - [Quick Sight Arena](https://community.amazonquick.com/t/quicksight-arena-an-embedded-instance-of-quicksight-within-the-quicksight-community/21437))

---

<div class="post-metadata">

**Author:** ![Xclipse](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/xclipse/32/20455_2.png) [@Xclipse](https://community.amazonquick.com/u/Xclipse)\
**Post date:** [June 1, 2024, 4:23am UTC](https://community.amazonquick.com/t/problems-plotting-an-average-calculated-with-sumover/29671/5 "2024-06-01T04:23:27Z")

</div>

Archived on June 1, 2024, 4:23am UTC


