I used this search to test:
index=_internal | stats count by date_month,sourcetype| lookup test date_month | eval overage=count-allotment | where overage>0 | chart sum(count) as sum max(overage) as overage over date_month by sourcetype
The test lookup has the following content
date_month,allotment
january,1200
february,1000
Adopted to the info in your question I'd try the following:
index=xy data with activities and Group | stats sum(activities) as totalActivities by date_month,Group | lookup test date_month | eval overage=totalActivities-allotment | where overage>0 | chart max(totalActivities) as totalActivities max(overage) as overage over date_month
I hope this helps.
... View more