I think you need to group by count of members of groups, no?
That way you are counting the number of members for ythat group.
This is on GetGroupsWithOrWithoutMembersOFGroups aggregate

And i think you need to change the filter

To: on the aggregate with the name GetGroupsWithOrWithoutMembersOFGroups

Let me know if i could help you.
Kind regards,
Márcio