# Take/calculate value from dashboard

**URL:** <https://discuss.elastic.co/t/take-calculate-value-from-dashboard/259093>\
**Category:** Kibana\
**Created:** [December 18, 2020, 11:56am UTC](https://discuss.elastic.co/t/take-calculate-value-from-dashboard/259093 "2020-12-18T11:56:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [December 18, 2020, 3:44pm UTC](https://discuss.elastic.co/t/take-calculate-value-from-dashboard/259093/2 "2020-12-18T15:44:55Z")

</div>

> Is it possible to calculate value directly from a dashboard?

The short answer is "no" -- you can't do this directly from a dashboard. _However_, you can achieve this using a TSVB visualization (which can then be embedded in a dashboard).

What you're looking to do is called a [bucket script aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-aggregations-pipeline-bucket-script-aggregation.html), which is [not yet supported in our standard agg-based visualizations](https://github.com/elastic/kibana/issues/4707), but [can be done using TSVB as shown here](https://github.com/elastic/kibana/issues/4707#issuecomment-325997105). Another more detailed example can be found in this thread:

> [@Weighted Average in a DataTable of Kibana](https://discuss.elastic.co/t/weighted-average-in-a-datatable-of-kibana/185909/2):
>
> Hi Henrique, I think solving your problem will be a two-step process. You'll need to create a per-document field for cost \* volume, e.g. a field called volumeCost. You could create this field two ways, either by [reindexing your data](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-reindex.html#docs-reindex) and adding the field with a Painless script, or by creating a [scripted field](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html) that calculates this value on the fly. The first option is a little more performant when querying your data but the second option might be easier. I think you can create a Timeseries v…

---

_[View the full topic](https://discuss.elastic.co/t/take-calculate-value-from-dashboard/259093)._
