# Filters for line chart

**URL:** <https://community.amazonquick.com/t/filters-for-line-chart/27226>\
**Category:** Q&A\
**Tags:** dashboard, dashboards, charts, visuals, analysis, filters, visual, filters-controls-and-parameters, Business-Intelligence-Engineer, quick-sight\
**Created:** [March 13, 2024, 12:10pm UTC](https://community.amazonquick.com/t/filters-for-line-chart/27226 "2024-03-13T12:10:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TK2895](https://avatars.discourse-cdn.com/v4/letter/t/8797f3/32.png) [@TK2895](https://community.amazonquick.com/u/TK2895)\
**Post date:** [March 13, 2024, 12:10pm UTC](https://community.amazonquick.com/t/filters-for-line-chart/27226/1 "2024-03-13T12:10:39Z")

</div>

Hello community,

I have the below data. I am have created a visual like this.

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/9/b/9bb79d0f5f3c2a7b8c6a009265ddde6fd026d39f.png)

I am trying to add a filter where I can have a dropdown or a text field to add a specific OPT number to visualize just that OPT. I am not able to add a filter to the column names (OPT numbers are column names in my data). How can I achieve this? Any help is appreciated.

Many thanks,  
TK

| | OPT1 | OPT2 | OPT3 |
| --- | --- | --- | --- |
| 2024-02-04 15:00:00+00:00 | | 1 | 1 |
| 2024-02-04 16:00:00+00:00 | | 1 | 1 |
| 2024-02-04 17:00:00+00:00 | | 1 | 1 |
| 2024-02-04 18:00:00+00:00 | | 1 | 1 |
| 2024-02-04 19:00:00+00:00 | 1 | 1 | 1 |
| 2024-02-04 20:00:00+00:00 | 1 | 1 | 1 |
| 2024-02-04 21:00:00+00:00 | 1 | 1 | 1 |
| 2024-02-04 22:00:00+00:00 | 1 | 0 | 1 |
| 2024-02-04 23:00:00+00:00 | 1 | 0 | 1 |
| 2024-02-05 00:00:00+00:00 | 1 | 0 | 1 |
| 2024-02-05 01:00:00+00:00 | 1 | 0 | 1 |
| 2024-02-05 02:00:00+00:00 | 1 | 1 | 0 |
| 2024-02-05 03:00:00+00:00 | 1 | 1 | 0 |
| 2024-02-05 04:00:00+00:00 | 1 | 0 | 0 |
| 2024-02-05 05:00:00+00:00 | 0 | 0 | 0 |
| 2024-02-05 06:00:00+00:00 | 0 | 0 | 0 |
| 2024-02-05 07:00:00+00:00 | 0 | 0 | 0 |
| 2024-02-05 08:00:00+00:00 | 0 | 0 | 0 |
| 2024-02-05 09:00:00+00:00 | 0 | 0 | 0 |
| 2024-02-05 10:00:00+00:00 | 0 | 0 | 0 |
| 2024-02-05 11:00:00+00:00 | 0 | 1 | 0 |
| 2024-02-05 12:00:00+00:00 | 0 | 1 | 1 |
| 2024-02-05 13:00:00+00:00 | 0 | 1 | 1 |
| 2024-02-05 14:00:00+00:00 | 0 | 1 | 1 |
| 2024-02-05 15:00:00+00:00 | 0 | 1 | 1 |
| 2024-02-05 16:00:00+00:00 | 1 | 1 | 0 |
| 2024-02-05 17:00:00+00:00 | 1 | 1 | 0 |
| 2024-02-05 18:00:00+00:00 | 0 | 1 | 0 |

---

<div class="post-metadata">

**Author:** ![prantika\_sinha](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/prantika_sinha/32/21878_2.png) [@prantika\_sinha](https://community.amazonquick.com/u/prantika_sinha)\
**Post date:** [March 13, 2024, 12:20pm UTC](https://community.amazonquick.com/t/filters-for-line-chart/27226/2 "2024-03-13T12:20:48Z")

</div>

Hi @TK2895 ,

For this filtering, we would need to create a parameter followed by a calculated field and use that instead of all 3 fields in the line chart.  
Below is a step by step details:

1. create a parameter with single select text type with default value set to either of the values
2. Add a control of the parameter with the dropdown config and specify the values you are planning , e.g. opt1, opt2, opt3
3. create a calculated field to create the Y axis field .  
ifelse($parameter=‘opt1’, {opt1},$parameter=‘opt2’,{opt2},{opt3})
4. Use this measure in the Y axis replacing the 3 separate fields.

Thanks.
