Posts Tagged ‘PowerApps sum’


I needed a quick PowerAppsapp to display some calculated averages based on documents created by an InfoPath form with recurring fields – imagine an expense report, and you will have imagined something similar.  There were some tricky steps to get this to work, so let me save you some time and trouble in getting there.

First, to connect PowerApps to a xml forms library data source, you first choose SharePoint then the site where the library is located, but when just lists appear, instead choose custom value (check the box) and enter just the library name. THE NAME CANNOT CONTAIN SPACES.  If your library name does contain spaces, you will have to create a new one and get the data into it.

Now add a gallery to the screen in PowerApps and put some fields onto the top datacard using labels.  Now if you want to add up the value of a field on each row of the gallery, create a label outside of the row datacards inside the gallery and set its text value to

Sum(Filter(dtasource.field, field > 0), field)

Or if the field can be negative, change the expression to !=, as skipping o values won’t change the sum.

Why sum(datasource.field) doesn’t work I don’t know, but it doesn’t.

Thanks are not necessary but always welcomed!