How to get the count, sum, average, maximum, and minimum of numbers in an array.

Japanese version.

Steps

For any calculation, an array of numbers is prepared first.

count

Use the length function in the expression.

length(variables('array'))

sum

A variable for the total is provided with an initial value of 0.

The contents of the array are repeated with "Apply to each".

The "Current item" is added by "Increment variable".

When the iteration is completed, the total value is obtained.

average

Divide the aforementioned total by the number of cases. The division is done with the div function.

Also, when averaging integers, the decimal point will be truncated, float function is also used.

div(float(variables('total')),length(variables('array')))

maximum

Use the max function in the expression.

max(variables('array'))

minimum

Use the min function in the expression.

min(variables('array'))

For those who want to learn Power Automate Cloud flow effectively

The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Cloud flow to streamline your workflow.

Links

Tips.(Power Automate Cloud flows)