Hi @eric-3590 ,
Welcome to Microsoft Q&A! Thanks for posting the question.
Based on my understanding, you are using Power Automate to build workflow (Please correct me if I misunderstood it).
You may refer to the discussion in the link below to achieve this goal.
Count Distinct Values for a group of list items
In case you have any pending queries, please feel free to use Power Automate community for your questions.
If your query was related to one of Azure services, can you please clarify that so that I may help you.
---
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.