Power Fx Cheat Sheet
Power Fx is the formula language behind Power Apps canvas apps, and almost every control property is a Power Fx formula. Remembering the exact syntax of every function is hard, especially which arguments are optional. This Power Fx cheat sheet lists 58 functions that makers use every day, grouped into Logic, Text, Date & Time, Math, Tables, Data and App. Each entry has the syntax, a plain-English description and a short example you can copy into Power Apps Studio.
Also known as: power fx functions, power apps formulas, power fx reference, power apps functions list, power fx examples.
58 functions
If
LogicIf(condition, then, [else])Returns one value when a condition is true and another when it is not.
If(Score >= 50, "Pass", "Fail")
Switch
LogicSwitch(value, match, result, [default])Compares a value with several cases and returns the first match.
Switch(Status, "New", Blue, "Done", Green, Gray)
And
LogicAnd(condition1, condition2, [...])True only when every condition is true. Works like the && operator.
And(Age >= 18, HasId)
Or
LogicOr(condition1, condition2, [...])True when at least one condition is true. Works like the double pipe operator.
Or(Role = "Admin", Role = "Owner")
Not
LogicNot(value)Reverses true and false.
Not(IsBlank(txtName.Text))
IsBlank
LogicIsBlank(value)True when a value is blank or empty text.
IsBlank(txtName.Text)
IsEmpty
LogicIsEmpty(table)True when a table or collection has no rows.
IsEmpty(colCart)
Coalesce
LogicCoalesce(value1, value2, [...])Returns the first value that is not blank.
Coalesce(txtNick.Text, "Guest")
IfError
LogicIfError(value, fallback)Returns a fallback when the first formula produces an error.
IfError(Value(txtQty.Text), 0)
With
LogicWith(record, formula)Names values once so a formula can reuse them.
With({tax: 0.2}, Price * (1 + tax))Text
TextText(value, [format])Converts a number or date to text with an optional format.
Text(Today(), "dd mmm yyyy")
Concat
TextConcat(table, formula, [separator])Joins the values from each row of a table into one text.
Concat(colTags, Value, ", ")
Left
TextLeft(text, count)Takes characters from the start of a text.
Left("PowerApps", 5)Mid
TextMid(text, start, [count])Takes characters from the middle of a text.
Mid("PowerApps", 6, 4)Len
TextLen(text)Counts the characters in a text.
Len(txtName.Text)
Upper
TextUpper(text)Converts text to upper case.
Upper(txtCode.Text)
Substitute
TextSubstitute(text, old, new, [instance])Replaces matching text inside another text.
Substitute(txtPhone.Text, " ", "")
Split
TextSplit(text, separator)Splits text into a one-column table.
Split("a,b,c", ",")Find
TextFind(find, within, [start])Returns the position of some text, or blank if it is not found.
Find("@", txtEmail.Text)StartsWith
TextStartsWith(text, start)True when a text begins with the given value.
StartsWith(Title, txtSearch.Text)
IsMatch
TextIsMatch(text, pattern, [options])Checks a text against a pattern or regular expression.
IsMatch(txtEmail.Text, Match.Email)
Value
TextValue(text, [language])Converts text to a number.
Value("42.5")Today
Date & TimeToday()Current date without a time.
Today()
Now
Date & TimeNow()Current date and time.
Now()
Date
Date & TimeDate(year, month, day)Builds a date from its parts.
Date(2026, 12, 31)
DateAdd
Date & TimeDateAdd(date, number, [unit])Adds days, months or other units to a date.
DateAdd(Today(), 7, TimeUnit.Days)
DateDiff
Date & TimeDateDiff(start, end, [unit])Counts the units between two dates.
DateDiff(StartDate, EndDate, TimeUnit.Days)
EOMonth
Date & TimeEOMonth(date, months)Returns the last day of a month.
EOMonth(Today(), 0)
Sum
MathSum(table, formula)Adds up a column or a list of numbers.
Sum(colOrders, Amount)
Average
MathAverage(table, formula)Averages a column or a list of numbers.
Average(colOrders, Amount)
Max
MathMax(table, formula)Finds the largest value.
Max(colOrders, Amount)
Round
MathRound(number, digits)Rounds a number to the given number of decimals.
Round(3.14159, 2)
Filter
TablesFilter(table, condition, [...])Returns the rows that match every condition.
Filter(Tasks, Status = "Open")
LookUp
TablesLookUp(table, condition, [result])Finds the first row that matches a condition.
LookUp(Users, ID = 5, Email)
Sort
TablesSort(table, formula, [order])Sorts a table by a formula.
Sort(Tasks, DueDate, SortOrder.Ascending)
SortByColumns
TablesSortByColumns(table, column, [order, ...])Sorts a table by one or more column names.
SortByColumns(Tasks, "Priority", SortOrder.Descending)
FirstN
TablesFirstN(table, [count])Returns the first rows of a table.
FirstN(Tasks, 10)
CountRows
TablesCountRows(table)Counts the rows in a table.
CountRows(Filter(Tasks, Done))
Distinct
TablesDistinct(table, formula)Returns the unique values of a column.
Distinct(Tasks, Category)
AddColumns
TablesAddColumns(table, name, formula, [...])Adds calculated columns to a table.
AddColumns(Users, "Full", First & " " & Last)
GroupBy
TablesGroupBy(table, column, [...], groupName)Groups rows by one or more columns.
GroupBy(Tasks, "Owner", "Rows")
ForAll
TablesForAll(table, formula)Runs a formula for every row of a table.
ForAll(colCart, Patch(Orders, Defaults(Orders), {Item: Item}))Patch
DataPatch(source, record, changes, [...])Creates or updates a record in a data source.
Patch(Tasks, Defaults(Tasks), {Title: "New"})Collect
DataCollect(collection, item, [...])Adds records to a collection.
Collect(colCart, {Item: "Pen", Qty: 2})ClearCollect
DataClearCollect(collection, item, [...])Empties a collection, then fills it with new data.
ClearCollect(colOpen, Filter(Tasks, Status = "Open"))
Clear
DataClear(collection)Removes all records from a collection.
Clear(colCart)
RemoveIf
DataRemoveIf(source, condition, [...])Deletes the records that match a condition.
RemoveIf(colCart, Qty <= 0)
SaveData
DataSaveData(collection, name)Saves a collection to the device storage.
SaveData(colCart, "cart")
Set
AppSet(name, value)Sets a global variable.
Set(gblUser, User().Email)
UpdateContext
AppUpdateContext({ name: value })Sets screen-level context variables.
UpdateContext({locOpen: true})Notify
AppNotify(message, [type], [timeout])Shows a banner message to the user.
Notify("Saved", NotificationType.Success)SubmitForm
AppSubmitForm(form)Saves the data in an edit form.
SubmitForm(frmTask)
Concurrent
AppConcurrent(formula1, formula2, [...])Runs several formulas at the same time.
Concurrent(ClearCollect(colA, A), ClearCollect(colB, B))
SetFocus
AppSetFocus(control)Moves keyboard focus to a control.
SetFocus(txtName)
RGBA
AppRGBA(red, green, blue, alpha)Builds a color from its parts.
RGBA(116, 39, 116, 1)
JSON
AppJSON(data, [format])Turns a table or record into JSON text.
JSON(colCart, JSONFormat.IndentFour)
ParseJSON
AppParseJSON(jsonText)Reads JSON text into an untyped object.
ParseJSON(txtJson.Text)
Features
- Search by function name or description
- Filter by category
- Copy an example with one click
- Syntax and an example for every function
How to use the Power Fx Cheat Sheet
- Type a function name, or a word such as filter, date or collection, into the search box.
- Pick a category button, such as Tables or Data, to narrow the list.
- Read the syntax line. Arguments in square brackets are optional, and [...] means you can repeat the argument.
- Click Copy example and paste it into the right property in Power Apps Studio, then replace the sample names with your own controls, tables and columns.
- Paste longer formulas into the Power Fx Formula Checker to catch typing mistakes before you test the app.
Real-world use cases: patterns you will use in almost every canvas app
Start with a form button. The most common Power Fx pattern is validate, then save, then tell the user. If(IsBlank(txtName.Text), Notify("Name is required", NotificationType.Warning), SubmitForm(frmTask)) uses three functions from this sheet (If, IsBlank and Notify) plus SubmitForm to save the data.
Next, a gallery. A gallery that shows open tasks sorted by due date, limited to 20 rows, can use FirstN(Sort(Filter(Tasks, Status = "Open"), DueDate, SortOrder.Ascending), 20) as its Items property. Read it from the inside out: Filter picks the rows, Sort orders them and FirstN limits the result. Most gallery formulas follow this shape.
Then think about delegation. Canvas apps fetch only 500 rows from a data source by default (you can raise this to 2,000 in the app settings) unless the data source can do the work itself, which is called delegation. Whether Filter, Search or Sort can be delegated depends on the data source and on the condition you use. When Power Apps Studio shows a blue underline and a delegation warning, simplify the condition or filter on an indexed column first, otherwise users will silently miss records.
Finally, load data quickly. In App OnStart or a screen's OnVisible, use Concurrent() to run several ClearCollect() calls at the same time, and keep formulas readable by naming repeated values with With(). Wrap calls that can fail, such as a flow run, in IfError() so the user sees a friendly message instead of a blank screen.
Example input and output
Formula: Items property of a gallery
FirstN(
Sort(
Filter(Tasks, Status = "Open"),
DueDate,
SortOrder.Ascending
),
20
)Result
The gallery shows the 20 open tasks with the earliest due dates. Check Studio for delegation warnings on your data source.
Formula: load two lists at the same time
Concurrent( ClearCollect(colTasks, Tasks), ClearCollect(colUsers, Users) )
Frequently asked questions
What is the difference between Patch, Collect and SubmitForm?
Patch creates or updates a record in a data source with the values you choose. Collect adds records to a collection in the app's memory. SubmitForm saves everything entered in an Edit form control and runs the form's validation. Use SubmitForm for forms, Patch for custom saves and Collect for local data.
What does delegation mean in Power Apps?
Delegation means the data source runs the filter or sort instead of the app. When a formula cannot be delegated, Power Apps checks only the first 500 rows by default, up to a maximum of 2,000, so results can be incomplete. Studio shows a blue underline and a warning when this happens.
Do I need to memorise Power Fx functions?
No. Learn the common patterns, look up the syntax when you need it and use IntelliSense in the formula bar. A cheat sheet speeds up the lookup, and the Formula Checker catches typing mistakes.
Why use PowerApps Ninja?
This cheat sheet runs entirely in your browser, with no sign-up and nothing to download. The examples follow patterns from real canvas apps instead of repeating one-line documentation snippets, and every formula can be checked with the Formula Checker on the same site.