Creating a report / Maximal member count of a Group (ADSGroup, AADGroup) in last month

Hi there, is there an OOTB functionality to set a report of the historical group memberships?

We have customers who receive a monthly invoice. The quantities are calculated based on the memberships in AD or AAD groups, specifically the maximum number from the previous month. Is there a table where I can get such data to use it in the report? 

This is a possible solution: We could create new fields in ADSGroup and AADGroup like and "Max this month" and "Max last month" and count the memberships on every change in ADSAccountInADSGroup for this group. Negative point is, that we need more processes. We could have problems, when the processes terminate without a result.

But could we do it more sophisticated? 

Best regards, Paul