Simply add the month column in the GROUP BY clause.
By the way, using HAVING on a column on which you group - thus not an aggregate - is the same as using WHERE.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP