Hi guys,
So I am trying to get a user count for multiple tenants so thought I would run a Graph API query.
I have created the app registration in the target tenants and then running the following in flow:

This is working fine but the problem is I cant differentiate between current and old users. I have set the header to check for accounts that are enabled. This returns active users, archived users (shared mailboxes) as well as guest users. I tried to filter by active domain name using:
https://graph.microsoft.com/v1.0/users?$count=true&$filter=endsWith(mail,'@domain.com')
But that returns
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "Unsupported Query.",
"innerError": {
According to this MS doc, this should be supported (https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter)

Any idea where this is going wrong or perhaps you know of a better way to count active users?
Thanks,
David