# Showing percentage on the Y axis instead of count

**URL:** <https://discuss.elastic.co/t/showing-percentage-on-the-y-axis-instead-of-count/334428>\
**Category:** Kibana\
**Tags:** lens, visualisation\
**Created:** [May 26, 2023, 12:12pm UTC](https://discuss.elastic.co/t/showing-percentage-on-the-y-axis-instead-of-count/334428 "2023-05-26T12:12:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seemant\_Bind](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seemant_bind/32/107045_2.png) [@Seemant\_Bind](https://discuss.elastic.co/u/Seemant_Bind)\
**Post date:** [May 26, 2023, 12:12pm UTC](https://discuss.elastic.co/t/showing-percentage-on-the-y-axis-instead-of-count/334428/1 "2023-05-26T12:12:59Z")

</div>

Hi,

I want percentage contribution of female gender for the following in the Y axis instead of the count. For e.g., my current week shows 54 count and previous week shows 67 counts for **female** gender for **Angeldale** manufacturer (see the first attached screenshot). As the total count for the same manufacturer is 113 and 115 respectively for current and previous week (see the second attached screenshot), I want the Y axis to show the percentages i.e, 54/113=47.8% and 67/115=58.2% respectively for current and previous week.  
Please let me know if there is any work around for this.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/c/6cfa9b405cd8d90ad7f31b9b6d83e5268f846e66.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/9/a936c517b56a8b571bbb26cfb02e2ee02f6f49fa.png)

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [May 26, 2023, 1:00pm UTC](https://discuss.elastic.co/t/showing-percentage-on-the-y-axis-instead-of-count/334428/2 "2023-05-26T13:00:06Z")

</div>

Hi @Seemant_Bind

this can easily be done with Lens formula: `overall_sum(count(kql="..."))/overall_sum(count())` and `overall_sum(count(kql="..."), shift="1w")/overall_sum(count(), shift="1w")`

---

<div class="post-metadata">

**Author:** ![Seemant\_Bind](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seemant_bind/32/107045_2.png) [@Seemant\_Bind](https://discuss.elastic.co/u/Seemant_Bind)\
**Post date:** [May 29, 2023, 6:36am UTC](https://discuss.elastic.co/t/showing-percentage-on-the-y-axis-instead-of-count/334428/3 "2023-05-29T06:36:53Z")

</div>

Hi @Marco_Liberati

Thanks for your quick response.  
Currently I am using ELK version 7.11.1, this formula thing is not available in the lens in this version. Is there any other work around?

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [May 29, 2023, 7:30am UTC](https://discuss.elastic.co/t/showing-percentage-on-the-y-axis-instead-of-count/334428/4 "2023-05-29T07:30:40Z")

</div>

Are you able to upgrade?

The only Alternative I see it's TSVB Top N with a Math aggregation.

---

<div class="post-metadata">

**Author:** ![Seemant\_Bind](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seemant_bind/32/107045_2.png) [@Seemant\_Bind](https://discuss.elastic.co/u/Seemant_Bind)\
**Post date:** [May 29, 2023, 12:25pm UTC](https://discuss.elastic.co/t/showing-percentage-on-the-y-axis-instead-of-count/334428/5 "2023-05-29T12:25:00Z")

</div>

I have tried it but was unable to figure it out. If you could provide some more details or give some example then it would be really helpful!!

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [May 29, 2023, 1:14pm UTC](https://discuss.elastic.co/t/showing-percentage-on-the-y-axis-instead-of-count/334428/6 "2023-05-29T13:14:22Z")

</div>

You can use an `Overall Sum` over a `Filter Ratio` in TSVB.  
In the numerator use the `kql` clause, while put `*` in the denominator.

---

<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 26, 2023, 1:14pm UTC](https://discuss.elastic.co/t/showing-percentage-on-the-y-axis-instead-of-count/334428/7 "2023-06-26T13:14:53Z")

</div>

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