# How can I force the order of labels?

**URL:** <https://discuss.elastic.co/t/how-can-i-force-the-order-of-labels/327424>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [March 10, 2023, 8:37am UTC](https://discuss.elastic.co/t/how-can-i-force-the-order-of-labels/327424 "2023-03-10T08:37:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wpq](https://avatars.discourse-cdn.com/v4/letter/w/3da27b/32.png) [@Wpq](https://discuss.elastic.co/u/Wpq)\
**Post date:** [March 10, 2023, 8:37am UTC](https://discuss.elastic.co/t/how-can-i-force-the-order-of-labels/327424/1 "2023-03-10T08:37:20Z")

</div>

I have data with a label `priority` that I show on a heatmap:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/0/7056c917d2eaad4ccb5e1103ae466e28947b0fc8.png)

The order at the bottom is not the one I would like to have (which is `CRITICAL`, `HIGH`, ...)

**How can I instruct Kibana to use a specific order for the labels?**

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [March 10, 2023, 4:42pm UTC](https://discuss.elastic.co/t/how-can-i-force-the-order-of-labels/327424/2 "2023-03-10T16:42:02Z")

</div>

Hi @Wpq. If you are using Lens, try changing from Top Values to Filters. Then specify the order you'd like to arrange the buckets in the x-axis.

Here's a quick example where I'm specifying the order of the `machine_name`. Notice how "win xp" appears before "win 7" instead of ordered alphabetically?

 ![Screenshot 2023-03-10 at 11-40-01 Lens - Elastic](https://us1.discourse-cdn.com/elastic/original/3X/7/6/766286ca5341ad88b31cf7f91be03074554385a3.jpeg)

---

<div class="post-metadata">

**Author:** ![Wpq](https://avatars.discourse-cdn.com/v4/letter/w/3da27b/32.png) [@Wpq](https://discuss.elastic.co/u/Wpq)\
**Post date:** [March 10, 2023, 7:29pm UTC](https://discuss.elastic.co/t/how-can-i-force-the-order-of-labels/327424/3 "2023-03-10T19:29:22Z")

</div>

Thank you @nickpeihl - this is exactly what I was looking for!

(I also [mentioned](https://stackoverflow.com/a/75700318/903011) your answer on Stack Overflow)

---

<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 7, 2023, 7:29pm UTC](https://discuss.elastic.co/t/how-can-i-force-the-order-of-labels/327424/4 "2023-04-07T19:29:36Z")

</div>

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