Display Metric Visualization in Abbrievated Number Format based on condition

Hi team,

I have a question related to number formatting in kibana.
I have created a metric visualization(sum) in Kibana using a number field(Sales).
I want to display the metric in abbreviated number format(m or k).

I want to display the metric in abbreviated form 'm' if it is greater than 1 Million or in abbreviated form 'k' if it is less than 1 Million.

I navigated to the index pattern and tried to edit the Numeral.js format pattern. But I think it only allows for one formatting.
I also tried it with Scripted Field. But I think it is at an individual record level and I don't think it allows for using aggregated metrics(like sum of sales) in condition.

I am using Kibana version 7.8.0.(Elastic search version is also 7.8.0)

Can you please point me in the right direction?


Did you try a format such as 0.0a? What was the result?

Hi Mathew,
I tried $ 0.00 ak. It automatically switches between k and m(which is what I wanted).
So, if we give 0.00 ak, it will automatically switch to m, b and t automatically if it encounters higher order numbers.Is my understanding correct?


correct. Here's a link to the code which does this - https://github.com/elastic/numeral-js/blob/kibana-fork/numeral.js#L102

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