# Sorting in Kibana Data Table Visualization

**URL:** <https://discuss.elastic.co/t/sorting-in-kibana-data-table-visualization/274200>\
**Category:** Kibana\
**Created:** [May 27, 2021, 11:35am UTC](https://discuss.elastic.co/t/sorting-in-kibana-data-table-visualization/274200 "2021-05-27T11:35:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![antony\_kavin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/antony_kavin/32/47894_2.png) [@antony\_kavin](https://discuss.elastic.co/u/antony_kavin)\
**Post date:** [May 27, 2021, 11:35am UTC](https://discuss.elastic.co/t/sorting-in-kibana-data-table-visualization/274200/1 "2021-05-27T11:35:30Z")

</div>

Hi All,

I have been using Elastic Cloud for more than 6 months now. The version I am using is 7.12.

I am trying to create a data table visualization in Kibana. I have a couple of buckets(Category and Sub-Category) and one metric(Count).While creating both the buckets, I have given 'Order by Metric Count' and 'Order Descending'.

What happens is, the information is first sorted based on 'Category'. And then within that Category, the Sub-Categories are sorted.

What I would like to achieve is, I want the information to be sorted based on the count in the combination of 'Category' and 'Sub-Category'.

I have attached a couple of screenshots below(Existing\_Behaviour and 'Trying\_to\_Achieve') for helping you understand the issue better. Let me know if you need any other information from my end.

Is there any way to achieve what I am trying to do?

Thanks,  
Antony

**Existing Behaviour:**  
 ![Existing_Behaviour](https://us1.discourse-cdn.com/elastic/original/3X/5/9/5986fedabdbe821d29ae23325c8f5b52cebb9381.png)

**Trying to Achieve:**  
 ![Trying_To_Achieve](https://us1.discourse-cdn.com/elastic/original/3X/8/5/850b4029f7c8aef7cd687f0e7dfc999391102eb6.png)

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [May 27, 2021, 2:36pm UTC](https://discuss.elastic.co/t/sorting-in-kibana-data-table-visualization/274200/2 "2021-05-27T14:36:29Z")

</div>

The Kibana data table visualizations (Lens, TSVB and aggregation based) allow column sorting, so you can click the Count column and sort all the rows in descending order. This does not fetch new data, so it just applies a second level of sorting.

For example, in Lens:

 ![Screen Shot 2021-05-27 at 10.36.16 AM](https://us1.discourse-cdn.com/elastic/original/3X/3/e/3e74ad4fab788b8344374b3acd1db2fae073058f.png)

---

<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:** [June 24, 2021, 2:36pm UTC](https://discuss.elastic.co/t/sorting-in-kibana-data-table-visualization/274200/3 "2021-06-24T14:36:53Z")

</div>

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