# Custom Field Doesn't Show Percentage in Metric

**URL:** <https://discuss.elastic.co/t/custom-field-doesnt-show-percentage-in-metric/168907>\
**Category:** Kibana\
**Created:** [February 18, 2019, 10:14pm UTC](https://discuss.elastic.co/t/custom-field-doesnt-show-percentage-in-metric/168907 "2019-02-18T22:14:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![schoffelman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/schoffelman/32/18461_2.png) [@schoffelman](https://discuss.elastic.co/u/schoffelman)\
**Post date:** [February 18, 2019, 10:14pm UTC](https://discuss.elastic.co/t/custom-field-doesnt-show-percentage-in-metric/168907/1 "2019-02-18T22:14:27Z")

</div>

I'm calculating a field against a known value. In this example I have a number of units that when calculated against 7500, it shows a value of 600%. When adding another 0 to make it 75,000 (the actual number i need to use) it doesn't give a value at all (it should be 60%). Additionally, I've changed the format default from Number to Percentage without any results.

Alternatively, I've also noticed that if you don't have a leading zero when multiplying, the script errors out. So, what I wonder is if Kibana is making the calculation, totaling my result with a decimal point but without a leading 0.

 ![kibana-custom-field](https://us1.discourse-cdn.com/elastic/original/3X/f/4/f4393a95acad76ea73c6c1cafdfd4aee3e135a6f.png)

My Kibana metric field is selected via "max" aggregation and then the name of the field. No buckets are selected and under options. In addition, i've tried all variations under options to try to obtain a different result with not luck.

 ![kibana-metric-options](https://us1.discourse-cdn.com/elastic/original/3X/a/c/acd683b3ef8fde9646ea418f716c4547b842ae74.png)

If anyone else has ran into this, i'd love to hear how you worked around it.

---

<div class="post-metadata">

**Author:** ![schoffelman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/schoffelman/32/18461_2.png) [@schoffelman](https://discuss.elastic.co/u/schoffelman)\
**Post date:** [February 18, 2019, 10:19pm UTC](https://discuss.elastic.co/t/custom-field-doesnt-show-percentage-in-metric/168907/2 "2019-02-18T22:19:33Z")

</div>

I was able to get my results by putting my equation in a parenthesis and then multiplying that result against 0.1, looking something like:

`(doc['units'].value / 7500) * 0.1`

Still, I shouldn't have to do that. Ideally i should be able to do this:

`(doc['units'].value / 75000)`

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [February 18, 2019, 11:03pm UTC](https://discuss.elastic.co/t/custom-field-doesnt-show-percentage-in-metric/168907/3 "2019-02-18T23:03:19Z")

</div>

Hello,

This looks like a bug. Can you please log it here?

> **[elastic/kibana](https://github.com/elastic/kibana/issues)**
>
> :bar\_chart: Kibana analytics and search dashboard for Elasticsearch - elastic/kibana

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![schoffelman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/schoffelman/32/18461_2.png) [@schoffelman](https://discuss.elastic.co/u/schoffelman)\
**Post date:** [February 23, 2019, 2:24am UTC](https://discuss.elastic.co/t/custom-field-doesnt-show-percentage-in-metric/168907/4 "2019-02-23T02:24:18Z")

</div>

Will do. Thank you @bhavyarm

---

<div class="post-metadata">

**Author:** ![schoffelman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/schoffelman/32/18461_2.png) [@schoffelman](https://discuss.elastic.co/u/schoffelman)\
**Post date:** [February 23, 2019, 2:34am UTC](https://discuss.elastic.co/t/custom-field-doesnt-show-percentage-in-metric/168907/5 "2019-02-23T02:34:17Z")

</div>

fwiw - I added this to the bug tracker: [https://github.com/elastic/kibana/issues/31866](https://github.com/elastic/kibana/issues/31866)

---

<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:** [March 23, 2019, 2:34am UTC](https://discuss.elastic.co/t/custom-field-doesnt-show-percentage-in-metric/168907/6 "2019-03-23T02:34:22Z")

</div>

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