# Kibana Canvas drop-down filter not updating count metric correctly

**URL:** <https://discuss.elastic.co/t/kibana-canvas-drop-down-filter-not-updating-count-metric-correctly/328062>\
**Category:** Kibana\
**Tags:** elastic-stack-sql, kibana-plugin-development\
**Created:** [March 20, 2023, 10:48am UTC](https://discuss.elastic.co/t/kibana-canvas-drop-down-filter-not-updating-count-metric-correctly/328062 "2023-03-20T10:48:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cristinan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cristinan/32/117317_2.png) [@cristinan](https://discuss.elastic.co/u/cristinan)\
**Post date:** [March 20, 2023, 10:48am UTC](https://discuss.elastic.co/t/kibana-canvas-drop-down-filter-not-updating-count-metric-correctly/328062/1 "2023-03-20T10:48:54Z")

</div>

![kibana_datetime_filter_dropdown_filters_any](https://us1.discourse-cdn.com/elastic/original/3X/c/2/c2a1e3d03d24e8e42ff369784c1e9dacb98036ca.png)  
 ![kibana_canvas_tenant_dropdown_filter_not_working](https://us1.discourse-cdn.com/elastic/original/3X/5/0/50ab5bdf13aa4947084d7951537299ad5be0f6a9.png)  
 ![tenant_RTL_IT_should_show_2_total_payments](https://us1.discourse-cdn.com/elastic/original/3X/e/2/e25cea4f8cc4ee238d73d60902950a9ce1fc23eb.jpeg)  
 ![kibana_canvas_metric_expression_editor](https://us1.discourse-cdn.com/elastic/original/3X/d/1/d1cbd3bad705181bb8ca5281a4757630fd04015c.png)  
 ![kibana_canvas_tenant_drop_down_filter](https://us1.discourse-cdn.com/elastic/original/3X/6/6/6608209400eeeef2d04b12ddf1541923b5804a3b.png)

My metric shows okay on dateTime filter, but not on drop down filter. The date time filter uses a column pmt-stsDtTm which is to be found in indices queried to populate drop-down filters.

I have uploaded also here how I populate the tenant filter.

---

<div class="post-metadata">

**Author:** ![Catherine\_Liu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/catherine_liu/32/34294_2.png) [@Catherine\_Liu](https://discuss.elastic.co/u/Catherine_Liu)\
**Post date:** [March 20, 2023, 9:17pm UTC](https://discuss.elastic.co/t/kibana-canvas-drop-down-filter-not-updating-count-metric-correctly/328062/2 "2023-03-20T21:17:27Z")

</div>

What version of Kibana are you on? There is a [known issue](https://github.com/elastic/kibana/issues/141526) that impacts Kibana 8.4.0+ where filters are not applying correctly when you use the `filters` function at the beginning of your expression. If you replace `filters` with `kibana | selectFilter` that may resolve the issue.

---

<div class="post-metadata">

**Author:** ![cristinan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cristinan/32/117317_2.png) [@cristinan](https://discuss.elastic.co/u/cristinan)\
**Post date:** [March 21, 2023, 11:32am UTC](https://discuss.elastic.co/t/kibana-canvas-drop-down-filter-not-updating-count-metric-correctly/328062/3 "2023-03-21T11:32:55Z")

</div>

> [@Catherine\_Liu](#):
>
> `kibana | selectFilter`

Thanks a lot Cathrine for the hint. Kibana and Elasticsearch version I use is: 7.17.5  
I do not see option 'selectFilter' to be chained after 'kibana' in 7.17.5

I see this is solved though in Kibana 8.6.1, where after I import the Canvas workpad created in 7.17.5, I directly get the construct you suggested.

Thanks again!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 18, 2023, 11:33am UTC](https://discuss.elastic.co/t/kibana-canvas-drop-down-filter-not-updating-count-metric-correctly/328062/4 "2023-04-18T11:33:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
