# Kibana formula for metric

**URL:** <https://discuss.elastic.co/t/kibana-formula-for-metric/357099>\
**Category:** Kibana\
**Created:** [April 9, 2024, 6:30pm UTC](https://discuss.elastic.co/t/kibana-formula-for-metric/357099 "2024-04-09T18:30:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liwei\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liwei_zhang/32/133121_2.png) [@Liwei\_Zhang](https://discuss.elastic.co/u/Liwei_Zhang)\
**Post date:** [April 9, 2024, 6:30pm UTC](https://discuss.elastic.co/t/kibana-formula-for-metric/357099/1 "2024-04-09T18:30:01Z")

</div>

Hello all,  
I'm new to Kibana and trying to make a table visualization that the metric would be:  
The max subscribers for each zip code and sum them for each AOI, the calculation in tableau looks like: {SUM({INCLUDE [AOI],[zip\_code]: MAX([Unique Subscribers])})}

Anyone can kindly help how can I make that happen? is there a way to write it in the formula?

Thanks

---

<div class="post-metadata">

**Author:** ![Liwei\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liwei_zhang/32/133121_2.png) [@Liwei\_Zhang](https://discuss.elastic.co/u/Liwei_Zhang)\
**Post date:** [April 9, 2024, 7:46pm UTC](https://discuss.elastic.co/t/kibana-formula-for-metric/357099/2 "2024-04-09T19:46:15Z")

</div>

Or I may add a scripted field to the data view? what should the query look like in this case
