Kibana dashboard DSL aggregations problem

You can't use aggregations in a filter - filter only operate on a per-document basis.

Can you explain which kind of visualization you want to build? Maybe there's another way to achieve your goal.