Introduction
In this article, we will see how to get a distinct count of SharePoint list items based on a specific column using Power Automate or Microsoft Flow.
Real-Life Business Use Case
Please refer to the below screenshot. Here, we need to retrieve distinct Project Count from the list below using Power Automate.
![Power Automate]()
Below is the overall structure of the flow. Now, let me explain each step in detail.
![Overall structure]()
Step 1. Manually Trigger a flow.
![Trigger a flow]()
Step 2. Add an action, “Get Items”.
Add SharePoint Site Address and List Name.
![SharePoint Site Address]()
Step 3. Initialize a variable named “ProjectArray”.
![ProjectArray]()
Step 4. Add an action, “Append to array variable”.
Select Variable and add ProjectName in the Value section.
![ProjectName]()
Step 5. Add action, Compose.
Add the following formula. This is a very important step. We need to use a union function where we need to add the following formula.
union(variables('ProjectArray'), variables('ProjectArray'))
![Formula]()
We can get Distinct records using Union expression inside Power Automate.
Step 6. Now, we need to find the length of the values returned in the above stage.
length(outputs('Compose'))
![Union expression]()
Now, let’s run a test of the flow!
Here, is the test of the flow. As we can see here, there were a total of 5 counts.
![Get Distinct Count From SharePoint List Item Using Power Automate]()
Conclusion
This is how we can find the distinct count from the SharePoint list for the Project ID. I hope this is clear now. Stay connected with me for more amazing Power Platform articles!
Happy Power Automating!