Can I make group by (time_interval) match the (time_filter)?

I apologize in advance if the docs explain this, I read over the auto and use of $__interval, but I think my use case is a little more specific.

Lets say I have a gauge panel where Im displaying the monthly uptime of a service.

So I started by adjusting the relative time to only show the last 30 days, that way regardless of what somewhat selects for the overall dashboard, I still show 30 days on this panel.

But the question came up, lets say we wanted to show the % uptime for the last 60, or 90 days.

Is there a way to tell grafana to make the group by (interval) match the duration of the timefilter, or time duration in the query.

So if I selected 60 days, it would automatically group by 60, for 90 days, it would group by 90 days, etc.

You don’t need time grouping for gauge panel. Just remove time grouping.