Description

The Average function calculates the average, or arithmetic mean, of its arguments.

Bạn đang xem: Average, max, min, stdevp, sum, and varp functions in power apps

The Max function finds the maximum value.

The Min function finds the minimum value.

The Sum function calculates the sum of its arguments.

The StdevP function calculates the standard deviation of its arguments.

The VarP function calculates the variance of its arguments.

You can supply the values for these functions as:

Separate arguments. For example, Sum( 1, 2, 3 ) returns 6.

Fields of the record currently being processed are available within the formula. Use the ThisRecord operator or simply reference fields by name as you would any other value. The As operator can also be used to name the record being processed which can help make your formula easier khổng lồ understand và make nested records accessible. For more information, see the examples below & working with record scope.

These functions operate on numeric values only. Other types of values, such as strings or records, are ignored. Use the Value function to lớn convert a string into a number.

The Average, Max, Min, & Sum functions can be delegated when used with a data source that supports delegation for these functions. However, StdevPVarP can"t be delegated for any data sources. If delegation is not supported, only the first portion of the data will be retrieved và then the function applied locally. The result may not represent the complete story. A delegation warning will appear at authoring time to remind you of this limitation & to suggest switching to delegable alternatives where possible. For more information, see the delegation overview.

Syntax

Average( NumericalFormula1, < NumericalFormula2, ... > )Max( NumericalFormula1, < NumericalFormula2, ... > )Min( NumericalFormula1, < NumericalFormula2, ... > )Sum( NumericalFormula1, < NumericalFormula2, ... > )StdevP( NumericalFormula1, < NumericalFormula2, ... > )VarP( NumericalFormula1, < NumericalFormula2, ... > )

NumericalFormula(s) - Required. Numeric values to lớn operate on.

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

Table - Required. Table to operate on.NumericalFormula - Required. Formula khổng lồ 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

Let"s say that you had a data source named Sales that contained a CostPerUnit column & a UnitsSold column, and you phối the Text property of a label to this function:Sum(Sales, CostPerUnit * UnitsSold)

The label would show total sales by multiplying the values in those columns for each record & then adding the results from all records together:

*

As a different example, let"s say that you had sliders that were named Slider1, Slider2, và Slider3 và a label with its Text property set khổng lồ this formula:Sum(Slider1.Value, Slider2.Value, Slider3.Value): The label would show the sum of all values khổng lồ which the sliders were set.Average(Slider1.Value, Slider2.Value, Slider3.Value): The label would show the average of all values to which the sliders were set.Max(Slider1.Value, Slider2.Value, Slider3.Value): The label would show the maximum of all values khổng lồ which the sliders were set.Min(Slider1.Value, Slider2.Value, Slider3.Value): The label would show the minimum of all values lớn which the sliders were set.StdevP(Slider1.Value, Slider2.Value, Slider3.Value): The label would show the standard deviation of all values lớn which the sliders were set.

Xem thêm: Trình Bày Nội Dung Xây Dựng Nền Quốc Phòng Toàn Dân An Ninh Nhân Dân Hiện Nay

VarP(Slider1.Value, Slider2.Value, Slider3.Value): The label would show the variance of all values lớn which the sliders were set.