Hi,
When you say "current month", I guess you care about the time window starting exactly at the beginning of the calendar month, not an arbitrary 4 weeks ago?
In that case, you would have to manually choose the time window just large enough (relative to the overall query evaluation timestamp) to only go back exactly to that time.
There's also a complex construct you could write using a subquery to select a rack power output only for those timestamps within the subquery that fall into a given month, but I'm not sure you want to go that far, and it introduces other potential issues, such as skipping over raw underlying values in case you don't choose the subquery resolution high enough. It's also more expensive.
In any case, I'm thinking of something like:
round(
max_over_time(
(
and on() # Filter rack power watt values down to only those from October
month() == 10
)[5w:]
)
)
...where 10 is the current month (October) and the 5w window is chosen generously to always cover at least a full month going backward from now.
Cheers,
Julius