# Average of counts in a grouping

**URL:** <https://discuss.elastic.co/t/average-of-counts-in-a-grouping/235337>\
**Category:** Kibana\
**Created:** [June 2, 2020, 12:43pm UTC](https://discuss.elastic.co/t/average-of-counts-in-a-grouping/235337 "2020-06-02T12:43:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abinash\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abinash_gupta/32/46906_2.png) [@Abinash\_Gupta](https://discuss.elastic.co/u/Abinash_Gupta)\
**Post date:** [June 2, 2020, 12:43pm UTC](https://discuss.elastic.co/t/average-of-counts-in-a-grouping/235337/1 "2020-06-02T12:43:37Z")

</div>

Hi All,

Is it possible to write below SQL query in Jivana Visualization? Below query works fine with Canvas SQL with display as average.

`Select count (a), b, c from "my-index" where x = 'some value' group by b,c`

Also I need to calculate the average of counts for all the groupings.

I tried to play around with TSVB, but could not come up with a solution.

Thanks in advance 😊

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [June 3, 2020, 12:52pm UTC](https://discuss.elastic.co/t/average-of-counts-in-a-grouping/235337/2 "2020-06-03T12:52:44Z")

</div>

SQL is not supported in Visualizations but you can configure a visualization to show the same results.

What does your canvas chart look like? Here are some docs for getting started with Kibana visualizations - [https://www.elastic.co/guide/en/kibana/current/visualize.html](https://www.elastic.co/guide/en/kibana/current/visualize.html)

---

<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:** [July 1, 2020, 12:52pm UTC](https://discuss.elastic.co/t/average-of-counts-in-a-grouping/235337/3 "2020-07-01T12:52:53Z")

</div>

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