# How to change the format of a cell given a value of a parameter

**URL:** <https://community.amazonquick.com/t/how-to-change-the-format-of-a-cell-given-a-value-of-a-parameter/5729>\
**Category:** Q&A\
**Tags:** feature-request, formatting, quick-sight\
**Created:** [August 31, 2022, 8:55pm UTC](https://community.amazonquick.com/t/how-to-change-the-format-of-a-cell-given-a-value-of-a-parameter/5729 "2022-08-31T20:55:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nftd](https://avatars.discourse-cdn.com/v4/letter/n/6de8d8/32.png) [@nftd](https://community.amazonquick.com/u/nftd)\
**Post date:** [August 31, 2022, 8:55pm UTC](https://community.amazonquick.com/t/how-to-change-the-format-of-a-cell-given-a-value-of-a-parameter/5729/1 "2022-08-31T20:55:59Z")

</div>

Hi, is there a way to change the format in a pivot table (for example) if the user change a parameter in the control bar?

For example, I have control which name is KPI and the user can select Spend and ROI.

- If the user selects Spend, then the cells will show the values as $ dollar
- If the user selects ROI, then the cells will show the values as % percentage

Thanks!

---

<div class="post-metadata">

**Author:** ![rajjaya](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/rajjaya/32/4534_2.png) [@rajjaya](https://community.amazonquick.com/u/rajjaya)\
**Post date:** [September 1, 2022, 5:54am UTC](https://community.amazonquick.com/t/how-to-change-the-format-of-a-cell-given-a-value-of-a-parameter/5729/2 "2022-09-01T05:54:23Z")

</div>

Hi @nftd ,

You can implement this in two different ways.

1. Calculated field:  
You can create a calculated field with an expression similar tot he following where ‘test’ is a parameter associated with a control, and ‘Forecasted Monthly Revenue’ is the field value that has to be shown in $ currency or percentage.

ifelse(${test}=‘Spend’,concat(‘$’,toString({Forecasted Monthly Revenue})),concat(toString({Forecasted Monthly Revenue}\*100),‘%’))

Please note that this might not format the values with separators. For example, the value would look like 2040000%, $20677 etc.

1. Conditional rendering.  
This option involves creating two different pivot tables, layered one over the other and shown/hidden based on parameter control value selection. This would allow you additional customization of fields, separators etc so you can format the pivot table as per your requirement.  
A sample and how to is provided in our demo central site [here](https://democentral.learnquicksight.online/#Dashboard-FeatureDemo-Free-form-Layout-Conditional-Rendering).

---

<div class="post-metadata">

**Author:** ![nftd](https://avatars.discourse-cdn.com/v4/letter/n/6de8d8/32.png) [@nftd](https://community.amazonquick.com/u/nftd)\
**Post date:** [September 1, 2022, 3:53pm UTC](https://community.amazonquick.com/t/how-to-change-the-format-of-a-cell-given-a-value-of-a-parameter/5729/3 "2022-09-01T15:53:19Z")

</div>

I love the second option! Thank you so much.
