# Barchart date histogram on two dates

**URL:** <https://discuss.elastic.co/t/barchart-date-histogram-on-two-dates/104388>\
**Category:** Kibana\
**Created:** [October 18, 2017, 12:24pm UTC](https://discuss.elastic.co/t/barchart-date-histogram-on-two-dates/104388 "2017-10-18T12:24:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geujvari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geujvari/32/21017_2.png) [@geujvari](https://discuss.elastic.co/u/geujvari)\
**Post date:** [October 18, 2017, 12:24pm UTC](https://discuss.elastic.co/t/barchart-date-histogram-on-two-dates/104388/1 "2017-10-18T12:24:39Z")

</div>

Hello,

I have an index in Kibana which has two date fields (start\_date, end\_date) and a datasource field and some others.

I want to create a barchart visualisation which counts the documents for a time period grouped by the datasource.  
However for the time period there is a complication that I want to count the documents where either the start\_date or the end\_date fits into the period.

So how can I do that? Can I do somehow an "or" date histogram for two fields? (and add a terms subbucket for the datasource field)

I'm using Kibana 5.5

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [October 18, 2017, 12:37pm UTC](https://discuss.elastic.co/t/barchart-date-histogram-on-two-dates/104388/2 "2017-10-18T12:37:28Z")

</div>

This currently not possible. An aggregation only works with a single field

---

<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:** [November 15, 2017, 12:37pm UTC](https://discuss.elastic.co/t/barchart-date-histogram-on-two-dates/104388/3 "2017-11-15T12:37:29Z")

</div>

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