Aggregate functions have one of the most common applications while building your Canvas Power App.
In this simple example, we’ll try to make common Aggregate Functions like Max, Min, Sum & Average work.
There are 2 more advanced Aggregate Functions, StdevP for Standard Deviation and VarP for Variance. (It might not make full sense in this post, but I added them anyway to see how we can apply for formula 😊 I’m sure your use-case will make more sense!)
Let’s say, my SharePoint list looks like this. Scores of some people and their ranks
And I’m using Data Table to populate this into my Canvas Power App
Here’s how I used for Formulas to use the Aggregate functions on the SharePoint list data I populated in my Canvas Power App
For all the Formulas above, I’ve written them inside a Concatenate function just so I could add some Text and then use the formulas. You may use differently.
In my case, the Formula goes like this –
“Max” – Maximum Number in Score column of Scoreboard list
“Min” – Smallest Number in Score column of Scoreboard list
“Sum” = Total of all values in Score column of Scoreboard list
“Average” – Average of all values in Score column of Scoreboard list
“StdevP” – Standard Deviation arguments passed. Score column in this case
“VarP”-Variance of the arguments passed. Score column in this case
And that’s it! I tried to simply the explanation. However’s there much more to consider as well. Here’s the full documentation by Microsoft – https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-aggregates
You might want to check some posts on Canvas Power Apps as well –
- Count of total CDS records returned in a Canvas Power App connection [Quick Tip]
- Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform
- Restore older version of a Canvas Power App | Power Platform
- Implement character length validation in a Canvas Power App | Power Platform
- Logged In User details in a Canvas Power App
- Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
- Variables in Canvas Power Apps | Global and Context
- Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
- Sending Image from Canvas PowerApps to SharePoint Document Library using Flows
- Correctly connect to an Excel file in a Canvas PowerApp
Hope this was helpful!