Changing the BIN depending on time range selected?

We are trying to figure out our timestream data. For some time periods we want to show BIN(time,1h) for others we want to show BIN(time,6h), basically changing the frequency of the data points.