The Power Automate Max function lets you find the maximum value within a collection.
Its counterpart is the min function that lets you find the minimum value within a collection.
In this article, I’ll introduce you to the max function and will provide a step-by-step guide on how to use the function in a Microsoft flow.
Power Automate Max Function
Power Automate Max Function

Return the maximum element from a set of numbers or an array.
Syntax
max(<number1>, <number2>, ...)
max([<number1>, <number2>, ...])
Input parameters
- <number1>, <number2>, … (mandatory): The set of numbers from which you desire the largest value.
- [<number1>, <number2>, …]: The array of numbers from which you desire the largest value..
Return value
- Returns the largest number in the given set or array.
Power Automate Max Expression Example
max(2,1,7,3,9,4)
=> 9
max(variables('myNumbers')). // myNumbers = [2,1,7,3,9,4]
=> 9
max(createArray(3,0,4,2))
=> 4
How To Use The Power Automate Max Function
Follow the steps to use the Power Automate max function in a flow.
-
Create a new flow with trigger ‘Manually trigger a flow’
New flow
-
Add a new step by clicking on ‘+ New step’
Add a new step
-
Search for ‘initialize’ and click on ‘Initialize variable’
Add Initialize variable action
-
Setup Initialize variable: 1) Provide a name, 2) select type Array, 3) Set value to ‘[2,1,7,3,9,4]’
Setup variable
-
Add a compose step by searching for ‘compose’ and clicking on ‘Compose’
Add Compose action
-
Setup compose action: 1) click into Inputs (popup appears), 2) click on ‘Expressions’, 3) set expression to ‘max(variables(‘myNumbers’))’, 4) click on ‘OK’
Setup max expression in Power Automate
-
Save and do a test run
Result test run – Power Automate Max function example