# LOD Functions in Quicksight

**URL:** <https://community.amazonquick.com/t/lod-functions-in-quicksight/2123>\
**Category:** Q&A\
**Tags:** analysis, calculations, quick-sight\
**Created:** [March 7, 2022, 8:27pm UTC](https://community.amazonquick.com/t/lod-functions-in-quicksight/2123 "2022-03-07T20:27:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbalchi](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@bbalchi](https://community.amazonquick.com/u/bbalchi)\
**Post date:** [March 7, 2022, 8:27pm UTC](https://community.amazonquick.com/t/lod-functions-in-quicksight/2123/1 "2022-03-07T20:27:45Z")

</div>

I have one dimension in Multiple Rows  
Opportunity ID | Opportunity Values  
XXX | 1000  
XXX | 1000  
XXX | 1000  
YYY | 500  
YYY | 500

When I aggregate the Value in this table I should see 1500$ instead of $4000. Could you please help me with that.  
If I created  
avgover(avg(Value), opportunityid) calculated field, I’m getting error message. Also I cannot use that field without opportunityid in the view. Please help to resolve this issue.

---

<div class="post-metadata">

**Author:** ![darcoli](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@darcoli](https://community.amazonquick.com/u/darcoli)\
**Post date:** [March 7, 2022, 9:29pm UTC](https://community.amazonquick.com/t/lod-functions-in-quicksight/2123/2 "2022-03-07T21:29:20Z")

</div>

Not sure what error message you are getting but this is the correct syntax (assuming you want to get the average not sum as in your example)

```auto
avgOver(AVG({Value},[{opportunityid}])

```

---

<div class="post-metadata">

**Author:** ![emilyzhu](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/emilyzhu/32/255_2.png) [@emilyzhu](https://community.amazonquick.com/u/emilyzhu)\
**Post date:** [March 8, 2022, 8:01am UTC](https://community.amazonquick.com/t/lod-functions-in-quicksight/2123/3 "2022-03-08T08:01:45Z")

</div>

Hi,` sumover(avg({Value}), [opportunityid])` should give you the right total of $1,500.

We are also developing a feature that will allow user to define any level for aggregation, independent of, high than or lower than the visual level. That feature will make this use case more straight forward.
