Power Fx Cheat Sheet
Look up the Power Fx functions you use most in Power Apps: the syntax, what each function does and a short example you can copy. Search by name or filter by category such as Logic, Text, Tables, Data and App.
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 or date, into the search box.
- Pick a category to narrow the list.
- Read the syntax, then press Copy example and paste it into Power Apps Studio.
Examples
Validate a field before saving
If(IsBlank(txtName.Text),
Notify("Name is required", NotificationType.Warning),
SubmitForm(frmTask)
)Frequently asked questions
Is this the full list of Power Fx functions?
No. It covers the functions most canvas app makers use every day. Microsoft documents the complete list.
Are Power Fx function names case-sensitive?
Yes. Write If, not if, and Filter, not filter. The formula checker on this site flags this mistake.