# Multiple Aggregations/UI Filters are not applied in ES|QL Visualizations

**URL:** <https://discuss.elastic.co/t/multiple-aggregations-ui-filters-are-not-applied-in-es-ql-visualizations/368952>\
**Category:** Kibana\
**Tags:** visualisation, esql\
**Created:** [October 16, 2024, 10:16pm UTC](https://discuss.elastic.co/t/multiple-aggregations-ui-filters-are-not-applied-in-es-ql-visualizations/368952 "2024-10-16T22:16:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KibanaUser2247](https://avatars.discourse-cdn.com/v4/letter/k/cab0a1/32.png) [@KibanaUser2247](https://discuss.elastic.co/u/KibanaUser2247)\
**Post date:** [October 16, 2024, 10:16pm UTC](https://discuss.elastic.co/t/multiple-aggregations-ui-filters-are-not-applied-in-es-ql-visualizations/368952/1 "2024-10-16T22:16:55Z")

</div>

I have an index that is of the form:

```auto
| event | hall | date | average_attendees |
|---------|----------|------------|-------------------|
| Event A | visitors | 2022-01-01 | 150 |
| Event A | main | 2022-01-01 | 250 |
| Event B | rotary | 2022-01-01 | 100 |
| Event A | main | 2022-01-02 | 300 |
| Event B | main | 2022-01-02 | 350 |

```

I want to display a table in Kibana that shows the _average daily attendees per-event_.

Crucially, this requires **two "group-by" operations**

So, using the table above:

- `Event A`'s Jan 1st Average is: `(150+350)/2=200`
- `Event B`'s Jan 1st Average is: `250`
- `Event A`'s Jan 2nd Average is: `300`
- `Event B`'s Jan 2nd Average is: `350`

That is the first group-by. The second one would aggregate across days, ending up with a table of the form:

```auto
| event | avg_attendees |
|---------|---------------|
| Event A | 250 |
| Event B | 225 |

```

Using ES|QL, this would be something like:

```auto
FROM index |
STATS daily_avg = AVG(attendees) BY event, date |
STATS avg_attendees=AVG(daily_avg) BY event

```

Simple enough so far.

* * *

**My Problem:**

In Kibana, my users can adjust the global filters, either by `date` or by `event`... but when that happens, the ES|QL table doesn't change?

I think based on [this](https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-limitations.html#esql-limitations-kibana) it seems like it's not supported?

Is there any way I can have a **dynamically updating** table that _also uses two group by_ 's?

I know there are breakdown's in the native "table" visualization, but that only does it once. Can I stack those?

Is there any solution for what I want to do?
