# How to make dynamic calculation in a table based on drop down selection

**URL:** <https://community.amazonquick.com/t/how-to-make-dynamic-calculation-in-a-table-based-on-drop-down-selection/39151>\
**Category:** Q&A\
**Tags:** calculations, filters-controls-and-parameters, Business-Intelligence-Engineer, quick-sight\
**Created:** [November 27, 2024, 9:11pm UTC](https://community.amazonquick.com/t/how-to-make-dynamic-calculation-in-a-table-based-on-drop-down-selection/39151 "2024-11-27T21:11:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HHXIAO](https://avatars.discourse-cdn.com/v4/letter/h/fbc32d/32.png) [@HHXIAO](https://community.amazonquick.com/u/HHXIAO)\
**Post date:** [November 27, 2024, 9:11pm UTC](https://community.amazonquick.com/t/how-to-make-dynamic-calculation-in-a-table-based-on-drop-down-selection/39151/1 "2024-11-27T21:11:26Z")

</div>

Dear Quick Sight Experts,

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

I want to create a dashboard with drop down menu for (A, B, C, D) options.

If I choose A, the table should show columns: B vs A (in %), C vs A (in %), D vs A (in %).

If I choose B, the table should show columns: A vs B (in %), C vs B (in %), D vs B (in %)

If I choose C, the table should show columns: A vs C (in %), B vs C (in %), D vs C (in %)

The same if I choose D…

And the calculation should change accordingly.

With which function can I achieve this?

Thanks a lot for your help!

---

<div class="post-metadata">

**Author:** ![Giridhar.Prabhu](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/giridhar.prabhu/32/27789_2.png) [@Giridhar.Prabhu](https://community.amazonquick.com/u/Giridhar.Prabhu)\
**Post date:** [November 28, 2024, 5:38am UTC](https://community.amazonquick.com/t/how-to-make-dynamic-calculation-in-a-table-based-on-drop-down-selection/39151/2 "2024-11-28T05:38:30Z")

</div>

Hi @HHXIAO

Welcome to the Quick Sight Community!

You can achieve this using calculated fields. I am not sure about how to display the titles dynamically though.

a. Create a static value parameter as follows

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/0/3/0324fde34ec0c263ae7a5d90a3bfc75a0bd76855.png)  
b. Add that as a Control with the following settings so user can only select one value  
 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/8/c/8c42fcccac57578c91e541be79eaa1c987152385.png)  
c. Create a calculated field that holds the Base value based on your selection in the parameter  
 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/e/1/e127ed05805a2e57e6fd03113fb7481a1061536e.png)  
d. Create three Compare fields that hold the value of which is the field to compare the base with. One example is below  
 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/a/3/a31287b9a04fe321cf075123946fbbf68137ac4f.png)  
e. Create Difference in % field for each compare field. An example is provided below

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/c/e/ce4a407722dd9c22aada498383e976eb3dd5f011.png)  
f. Final result will be like this  
 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/7/e/7e710b599aa1c7b63fd965e7768270fa41f4c249.png)  
g. Test and fine tune the calculated fields

Hope this helps.

---

<div class="post-metadata">

**Author:** ![HHXIAO](https://avatars.discourse-cdn.com/v4/letter/h/fbc32d/32.png) [@HHXIAO](https://community.amazonquick.com/u/HHXIAO)\
**Post date:** [November 28, 2024, 8:54pm UTC](https://community.amazonquick.com/t/how-to-make-dynamic-calculation-in-a-table-based-on-drop-down-selection/39151/3 "2024-11-28T20:54:20Z")

</div>

Thank you sooooo much Giridhar.Prabhu! Really helped!
