All Power Apps Math & Statistical Functions (With Examples) (2024)

Math and statistical functions are among the most used functions in Power Apps. Fortunately, they are also some of the easiest functions to learn. Doing math inside of Power Apps has a lot in common with Microsoft Excel. Many of the core functions like SUM and COUNT are exactly the same. In this article I will list all the Power Apps math & statistical functions and show examples of how to use them.

Table Of Contents:Math FunctionsABS FunctionMOD FunctionPI FunctionPOWER FunctionSQRT FunctionSUM FunctionStatistical FunctionsAVERAGE FunctionCOUNT FunctionMAX FunctionMIN FunctionSTDEVP FunctionVARP FunctionRounding FunctionsROUND FunctionROUNDUP FunctionROUNDDOWN FunctionINT FunctionTRUNC FunctionCount FunctionsCOUNTA FunctionCOUNTIF FunctionCOUNTROWS FunctionRandom FunctionsRAND FunctionRANDBETWEEN FunctionLogarithm FunctionsEXP FunctionLN FunctionLOG Function 


Math Functions

Abs Function

All Power Apps Math & Statistical Functions (With Examples) (1)

Purpose
Gets the absolute value of a number (without signs). A negative number becomes positive. Positive numbers remain positive.


Syntax

Abs(number)


Arguments

number – a number value to remove signs from


Example

Abs(-3) // Result: 3Abs(5) // Result: 5Abs(0) // Result: 0

Mod Function

All Power Apps Math & Statistical Functions (With Examples) (2)

Purpose

Returns the remainder of a number divided by another number


Syntax

Mod(number, divisor)


Arguments

number – a number value to divide.

divisor– a number to divide another number with.

Example

Mod(10, 3) // Result: 1Mod(10, 7) // Result: 3Mod(10, 5) // Result: 0

Pi Function

All Power Apps Math & Statistical Functions (With Examples) (3)

Purpose

Returns the mathematical constant Pi (π)


Syntax

Pi()


Example

Pi() // Result: 3.14159265359

Power Function

All Power Apps Math & Statistical Functions (With Examples) (4)

Purpose

Raises a number to the power of another number


Syntax

Power(base, exponent)


Arguments

base – the base number to raise

exponent – the exponent to raise a base number by

Example

Power(10, 2) // Result: 100Power(10, 3) // Result: 1000Power(5, 3) // Result: 125

Sqrt Function

All Power Apps Math & Statistical Functions (With Examples) (5)

Purpose

Get the square root of a number.


Syntax

Sqrt(number)


Arguments

number – a number value to get the square root of

Example

Sqrt(4) // Result: 2Sqrt(16) // Result: 4Sqrt(1) // Result: 1

Sum Function

All Power Apps Math & Statistical Functions (With Examples) (6)

Purpose

Calculates the sum for a table of numbers


Syntax

Sum(source, expression)


Arguments

source – a table of numbers to be added

expression – a formula evaluated for each row of table that provides a set of numbers to be added together

Example

Sum([1,2,3,4,5], Value) // Result: 15Sum( Table( {Letter: "A", Value: 1}, {Letter: "B", Value: 2}, {Letter: "C", Value: 3}, {Letter: "D", Value: 4}, {Letter: "E", Value: 5} ), Value)// Result: 15


Statistical Functions

Average Function

All Power Apps Math & Statistical Functions (With Examples) (7)

Purpose
Calculates the average (arithmetic mean) for a table of numbers


Syntax

Average(source, expression)


Arguments

source – a table of numbers to get the average from

expression – a formula evaluated for each row of table that provides a set of numbers to be averaged


Example

Average([1,2,3,4,5], Value) // Result: 3Average([3,4,6,9], Value) // Result: 5.5

Count Function

All Power Apps Math & Statistical Functions (With Examples) (8)

Purpose
Counts the number values in a single column table


Syntax

Count(source, expression)


Arguments

source – a single-column table of numbers to count

expression – a logical expression that decides which numbers to include in the count


Example

Count([2,4,6]) // Result: 3Count([2,4,6,8]) // Result: 4Count([2,4,6,8,Blank()]) // Result: 4

Max Function

All Power Apps Math & Statistical Functions (With Examples) (9)

Purpose
Returns the maximum value from a table of numbers


Syntax

Max(source, expression)


Arguments

source – a table of numbers to get the maximum from

expression – a formula evaluated for each row of table that provides a set of numbers for the maximum value calculation


Example

Average([1,2,3,4,5], Value) // Result: 5Average([-2-1,0,1,2], Value) // Result: 2

Min Function

All Power Apps Math & Statistical Functions (With Examples) (10)

Purpose
Returns the minimum value from a table of numbers


Syntax

Min(source, expression)


Arguments

source – a table of numbers to get the minimum from

expression – a formula evaluated for each row of table that provides a set of numbers for the minimum value calculation


Example

Min([1,2,3,4,5], Value) // Result: 1Min([-2-1,0,1,2], Value) // Result: -2

StdevP Function

All Power Apps Math & Statistical Functions (With Examples) (11)

Purpose
Calculates the standard deviation for a table of numbers


Syntax

StdevP(source, expression)


Arguments

source – a table of numbers to get the standard deviation from

expression – a formula evaluated for each row of table that provides a set of numbers for the standard deviation calculation


Example

StdevP([1,2,3,4,5], Value) // Result: 1.41421356StdevP([1,3,7,11], Value) // Result: 3.84057287

VarP Function

All Power Apps Math & Statistical Functions (With Examples) (12)

Purpose
Calculates the variance for a table of numbers


Syntax

VarP(source, expression)


Arguments

source – a table of numbers to get the variance

expression – a formula evaluated for each row of table that provides a set of numbers for the variance calculation


Example

VarP([1,2,3,4,5], Value) // Result: 3.84057287VarP([1,3,7,11], Value) // Result: 14.75


Rounding Functions

Round Function

All Power Apps Math & Statistical Functions (With Examples) (13)

Purpose
Rounds a number to the nearest number with the chosen number of digits


Syntax

Round(number, num_digits)


Arguments

number – a number to round

num_digits – the number of decimal places in the rounded number


Example

Round(3.2, 0) // Result: 3Round(5.75, 1) // Result: 5.8Round(1.355, 2) // Result: 1.36

RoundUp Function

All Power Apps Math & Statistical Functions (With Examples) (14)

Purpose
Rounds a number up to the next number with the chosen number of digits


Syntax

RoundUp(number, num_digits)


Arguments

number – a number to round up

num_digits – the number of decimal places in the rounded number


Example

RoundUp(3.2, 0) // Result: 4RoundUp(5.75, 1) // Result: 5.8RoundUp(1.355, 2) // Result: 1.36

RoundDown Function

All Power Apps Math & Statistical Functions (With Examples) (15)

Purpose
Rounds a number down to the next number with the chosen number of digits


Syntax

RoundDown(number, num_digits)


Arguments

number – a number to round down

num_digits – the number of decimal places in the rounded number


Example

RoundDown(3.2, 0) // Result: 3RoundDown(5.75, 1) // Result: 5.7RoundDown(1.355, 2) // Result: 1.35

Int Function

All Power Apps Math & Statistical Functions (With Examples) (16)

Purpose
Rounds a decimal number or a text value to the nearest integer (a number with no decimals)


Syntax

Int(number)


Arguments

number – a number to change into an integer


Example

Int(3.2) // Result: 3Int(5.75) // Result: 6Int("1") // Result: 1

Trunc Function

All Power Apps Math & Statistical Functions (With Examples) (17)

Purpose
Removes the decimals from a number


Syntax

Trunc(number)


Arguments

number – a number to truncate


Example

Trunc(3.2) // Result: 3Trunc(5.75) // Result: 5Trunc(1) // Result: 1


Count Functions

CountA Function

All Power Apps Math & Statistical Functions (With Examples) (18)

Purpose
Counts the number and text values in a single column table. An empty string “” counts as a non-blank value


Syntax

CountA(number, num_digits)


Arguments

source – a single-column table of numbers or text to count

expression – a logical expression that decides which numbers to include in the count


Example

CountA([2,4,6]) // Result: 3CountA(["A","B","C","D"]) // Result: 4CountA(["A","B","C","D",""]) // Result: 5

CountIf Function

All Power Apps Math & Statistical Functions (With Examples) (19)

Purpose
Counts the number of rows in a table which meet a set of conditions


Syntax

CountIf(source, condition1 [, condition2, …])


Arguments

source – a table of values to count

condition – a logical expression evaluated for each row of the table that decides which rows to count


Example

CountIf(["A","B","A","A","B"], Value="A") // Result: 3CountIf(["A","B","A","A","B"], Value="B") // Result: 2CountIf( Table( {Test:"English", Score: 90}, {Test:"English", Score: 55}, {Test:"Math", Score: 73}, {Test:"Math", Score: 85} ), Score>=65)// Result: 3

CountRows Function

All Power Apps Math & Statistical Functions (With Examples) (20)


Purpose
Counts the number of rows in a table


Syntax

CountRows(source)


Arguments

source – a table whose rows will be counted


Example

CountRows( Table( {Value: "A"}, {Value: "B"}, {Value: "C"} ))// Result: 3


Random Functions

Rand Function

All Power Apps Math & Statistical Functions (With Examples) (21)

Purpose
Generates a psuedo-random decimal number between 0 and 1

Syntax

Rand()


Example

// Result: 0.18009472// Result: 0.25365866// Result: 0.52303658

RandBetween Function

All Power Apps Math & Statistical Functions (With Examples) (22)

Purpose
Generates a random number within a range

Syntax

RandBetween(bottom, top)

Syntax

bottom – the lowest random number in the range

top – the greatest random number in the range


Example

// RandBetween(3, 7) // Result: 4// RandBetween(3, 7) // Result: 3// RandBetween(3, 7) // Result: 6


Logarithm

Functions

Exp Function

All Power Apps Math & Statistical Functions (With Examples) (23)

Purpose
Returns e to the power of a given number. The mathematical constant e (also known as Euler’s number) is equal to 2.71828182845904, the base of the natural logarithm.


Syntax

Exp(number)


Arguments

number – the number e is raised to the power of


Example

Exp(1) // Result: 2.71828182845Exp(2) // Result: 7.38905609893

Ln Function

All Power Apps Math & Statistical Functions (With Examples) (24)

Purpose
Returns the natural logarithm of a number – the logarithm to the base of the number e (Euler’s number)


Syntax

Ln(number)


Arguments

number – the number to find the natural logarithm of


Example

Ln(2.71828182845) // Result: 1Ln(7.38905609893) // Result: 2 

Log Function

All Power Apps Math & Statistical Functions (With Examples) (25)

Purpose
Calculates the logarithm of a number for a given base


Syntax

Log(number, base)


Arguments

number – the number to calculate the logarithm for

base – the base of the logarithim


Example

Log(10, 10) // Result: 1Log(10, 15) // Result: 0.85027415Log(10, 20) // Result: 0.76862179 

Did You Enjoy This Article? 😺

Subscribe to get new Power Apps articles sent to your inbox each week for FREE

Questions?

If you have any questions or feedback about All Power Apps Math & Statistical Functions (With Examples) please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.

All Power Apps Math & Statistical Functions (With Examples) (2024)

FAQs

What are the most used functions in Power Apps? ›

Today, we review the Top 10 Power Apps Functions You Should Know (With Examples), including If, Collect, Filter, Sort, Patch, Concat, CountRows, LookUp, Max, and Min, Average (some of the most commonly used functions in PowerApps).

Can Power Apps do calculations? ›

A calculated column can contain values resulting from simple math operations, or conditional operations, such as greater than or if-else, and many others. You can accomplish all this by using Power Apps, no need to write code.

What is an example of a power function in math? ›

An example of a power function is f(x) = x^n, where x is the independent variable and n is a constant real number. In this function, the dependent variable f(x) is proportional to the nth power of x, such as f(x) = x^3.

What is the related function in Power Apps? ›

The Relate function links two records through a one-to-many or many-to-many relationship in Microsoft Dataverse. The Unrelate function reverses the process and removes the link. For one-to-many relationships, the Many table has a foreign-key field that points to a record of the One table.

What are the 6 major components of Power Apps? ›

The six major components of PowerApps are a gallery, screen, card, control, property, and function.

What are the three types of Power Apps? ›

There are three types of Power Apps – Canvas, Model-driven, and Power Pages. The last type is now a standalone service offering more enterprise app development features.

What are the basics of power functions? ›

A power function is in the form of f(x) = kx^n, where k = all real numbers and n = all real numbers. You can change the way the graph of a power function looks by changing the values of k and n. So in this graph, n is greater than zero.

Is sqrt xa a power function? ›

For example, the square root function f(x) = √x is a power function with p = 1/2. The larger p is, the quicker f(x) grows in the long run.

What is k in a power function? ›

Any function that can be written in the form f(x) = k • xa, where k and a are nonzero constants, is a power function. The constant a is the power, and k is the constant of variation, or constant of proportion.

What is the first function in Power Apps? ›

The First function returns the first record of a table. The FirstN function returns the first set of records of a table; the second argument specifies the number of records to return. The Last function returns the last record of a table.

Can you write functions in Power Apps? ›

With Power Apps user defined functions we can write a formula once and reuse the logic many times throughout an app. To do this we choose a function name, determine the inputs and their data types and write a formula to evaluate. Then we can call the function from anywhere in the app.

What is the Power Apps with function for all? ›

Description. The ForAll function evaluates a formula for all the records in a table. The formula can calculate a value and/or perform actions, such as modifying data or working with a connection. Use the With function to evaluate the formula for a single record.

What is the functionality of Powerapp? ›

Using Power Apps, you can quickly build custom business apps that connect to your data stored either in the underlying data platform (Microsoft Dataverse) or in various online and on-premises data sources (such as SharePoint, Microsoft 365, Dynamics 365, SQL Server, and so on).

References

Top Articles
Latest Posts
Article information

Author: Otha Schamberger

Last Updated:

Views: 5495

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Otha Schamberger

Birthday: 1999-08-15

Address: Suite 490 606 Hammes Ferry, Carterhaven, IL 62290

Phone: +8557035444877

Job: Forward IT Agent

Hobby: Fishing, Flying, Jewelry making, Digital arts, Sand art, Parkour, tabletop games

Introduction: My name is Otha Schamberger, I am a vast, good, healthy, cheerful, energetic, gorgeous, magnificent person who loves writing and wants to share my knowledge and understanding with you.