# PowerApps 中的 Average、Max、Min、StdevP、Sum 和 VarP 函数Average, Max, Min, StdevP, Sum, and VarP functions in PowerApps

## 说明Description

Average 函数可用于计算其参数的平均值（或算术平均值）。The Average function calculates the average, or arithmetic mean, of its arguments.

Max 函数用于查找最大值。The Max function finds the maximum value.

Min 函数用于查找最小值。The Min function finds the minimum value.

Sum 函数可用于对其参数求和。The Sum function calculates the sum of its arguments.

StdevP 函数可用于计算其参数的标准偏差。The StdevP function calculates the standard deviation of its arguments.

VarP 函数可用于计算其参数的方差。The VarP function calculates the variance of its arguments.

• 分别列出每个参数。Separate arguments. 例如，Sum( 1, 2, 3 ) 会返回 6。For example, Sum( 1, 2, 3 ) returns 6.
• 一个和一个对表进行运算的公式。A table and a formula to operate over that table. 通过公式对每条记录的值计算聚合。The aggregate will be calculated on the values of the formula for each record.

## 语法Syntax

Average( NumericalFormula1, [ NumericalFormula2, ... ] )Average( NumericalFormula1, [ NumericalFormula2, ... ] )
Max( NumericalFormula1, [ NumericalFormula2, ... ] )Max( NumericalFormula1, [ NumericalFormula2, ... ] )
Min( NumericalFormula1, [ NumericalFormula2, ... ] )Min( NumericalFormula1, [ NumericalFormula2, ... ] )
Sum( NumericalFormula1, [ NumericalFormula2, ... ] )Sum( NumericalFormula1, [ NumericalFormula2, ... ] )
StdevP( NumericalFormula1, [ NumericalFormula2, ... ] )StdevP( NumericalFormula1, [ NumericalFormula2, ... ] )
VarP( NumericalFormula1, [ NumericalFormula2, ... ] )VarP( NumericalFormula1, [ NumericalFormula2, ... ] )

• NumericalFormula(s) - 必需。NumericalFormula(s) - Required. 要运算的数值。Numeric values to operate on.

Average( Table, NumericalFormula )Average( Table, NumericalFormula )
Max( Table, NumericalFormula )Max( Table, NumericalFormula )
Min( Table, NumericalFormula )Min( Table, NumericalFormula )
Sum( Table, NumericalFormula )Sum( Table, NumericalFormula )
StdevP( Table, NumericalFormula )StdevP( Table, NumericalFormula )
VarP( Table, NumericalFormula )VarP( Table, NumericalFormula )

• Table - 必需。Table - Required. 要运算的表。Table to operate on.
• NumericalFormula - 必需。NumericalFormula - Required. 用于对每条记录求值的公式。Formula to evaluate for each record. 这个公式的结果用于聚合。The result of this formula is used for the aggregation. 你可以在公式中使用的表的列。You can use columns of the table in the formula.

## 示例Examples

### 分步操作Step by step

Sum(Sales, CostPerUnit * UnitsSold)Sum(Sales, CostPerUnit * UnitsSold)

Sum(Slider1.Value, Slider2.Value, Slider3.Value)Sum(Slider1.Value, Slider2.Value, Slider3.Value)