# Ignore some filters from calculated metric

**URL:** <https://community.amazonquick.com/t/ignore-some-filters-from-calculated-metric/32519>\
**Category:** Q&A\
**Tags:** formulas, filters, calculations, sum, Business-Intelligence-Engineer, filters-controls-and-parameters, quick-sight\
**Created:** [July 11, 2024, 6:19pm UTC](https://community.amazonquick.com/t/ignore-some-filters-from-calculated-metric/32519 "2024-07-11T18:19:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MajidFa](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@MajidFa](https://community.amazonquick.com/u/MajidFa)\
**Post date:** [July 11, 2024, 6:19pm UTC](https://community.amazonquick.com/t/ignore-some-filters-from-calculated-metric/32519/1 "2024-07-11T18:19:06Z")

</div>

In the table connected to the Quick Sight dashboard, the number of our daily orders is recorded. It is also specified which supplier each order is related to. I calculate the number of orders as follows:

`Number of Orders = Count({order_id})`

I have written a formula that calculates the total share of orders as a percentage as follows:

`Market share = percentOfTotal({orders})`

An example of the table output using these metrics is as follows:

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

I have placed a filter next to the table so that users can filter and view the top X providers in the table.

When the user, for example, enters the number 3 in this box, the percentage share of the orders for those suppliers is calculated only among those 3 suppliers instead of the total. How can I fix this issue?

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/2/c/2c6787b466936ebc5b52e12390adfb9f3d930b3f.png)

---

<div class="post-metadata">

**Author:** ![WLS-DM](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/wls-dm/32/36109_2.png) [@WLS-DM](https://community.amazonquick.com/u/WLS-DM)\
**Post date:** [July 11, 2024, 10:07pm UTC](https://community.amazonquick.com/t/ignore-some-filters-from-calculated-metric/32519/2 "2024-07-11T22:07:32Z")

</div>

Hello @MajidFa, if you want the calculation to ignore the filter for the visual, then you may want to switch from the percentOfTotal calculation to 2 LAC-W aggregations. This would allow you to utilize the PRE\_FILTER calculation level on the countOver functions. It would look something like this:

`countOver({order_id}, [{Providers}], PRE_FILTER)/countOver({order_id}, [], PRE_FILTER)`

This should still return the actual percent of total, even after excluding some of the other rows. I will mark this response as the solution, but please let me know if you have any remaining questions. Thank you!
