How to get the count for previous months

Hi,

Can someone help me to get the history of count for the below scenario?

image

Thanks
Vasanth

I see there is time attribute to utilize for my requirement.
Please ignore it.