I'm trying to make a (preferably bar) visualisation using the Max Bucket metric. The reason I'm using Max Bucket is because datapoints repeat per weekly basis spread over a year and I'm only looking for week with the maximum size. These metrics should again be bucketed between cities, however I can't order by the Max Bucket metric as it is greyed out, seen in the added image. Additionally order by Custom metric does not work as it doesn't include the max bucket metric. Why is it greyed out? And is there any workaround?
Using kibana 6.2.4 and ES 6.2.4