Gauge with dynamic maximum value

Thanks it works! In older Kibana instead of Bucket Script I had to use Calculation Aggregation.