Skip to content

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

    Logic
    If(condition, then, [else])

    Returns one value when a condition is true and another when it is not.

    If(Score >= 50, "Pass", "Fail")
  • Switch

    Logic
    Switch(value, match, result, [default])

    Compares a value with several cases and returns the first match.

    Switch(Status, "New", Blue, "Done", Green, Gray)
  • And

    Logic
    And(condition1, condition2, [...])

    True only when every condition is true. Works like the && operator.

    And(Age >= 18, HasId)
  • Or

    Logic
    Or(condition1, condition2, [...])

    True when at least one condition is true. Works like the double pipe operator.

    Or(Role = "Admin", Role = "Owner")
  • Not

    Logic
    Not(value)

    Reverses true and false.

    Not(IsBlank(txtName.Text))
  • IsBlank

    Logic
    IsBlank(value)

    True when a value is blank or empty text.

    IsBlank(txtName.Text)
  • IsEmpty

    Logic
    IsEmpty(table)

    True when a table or collection has no rows.

    IsEmpty(colCart)
  • Coalesce

    Logic
    Coalesce(value1, value2, [...])

    Returns the first value that is not blank.

    Coalesce(txtNick.Text, "Guest")
  • IfError

    Logic
    IfError(value, fallback)

    Returns a fallback when the first formula produces an error.

    IfError(Value(txtQty.Text), 0)
  • With

    Logic
    With(record, formula)

    Names values once so a formula can reuse them.

    With({tax: 0.2}, Price * (1 + tax))
  • Text

    Text
    Text(value, [format])

    Converts a number or date to text with an optional format.

    Text(Today(), "dd mmm yyyy")
  • Concat

    Text
    Concat(table, formula, [separator])

    Joins the values from each row of a table into one text.

    Concat(colTags, Value, ", ")
  • Left

    Text
    Left(text, count)

    Takes characters from the start of a text.

    Left("PowerApps", 5)
  • Mid

    Text
    Mid(text, start, [count])

    Takes characters from the middle of a text.

    Mid("PowerApps", 6, 4)
  • Len

    Text
    Len(text)

    Counts the characters in a text.

    Len(txtName.Text)
  • Upper

    Text
    Upper(text)

    Converts text to upper case.

    Upper(txtCode.Text)
  • Substitute

    Text
    Substitute(text, old, new, [instance])

    Replaces matching text inside another text.

    Substitute(txtPhone.Text, " ", "")
  • Split

    Text
    Split(text, separator)

    Splits text into a one-column table.

    Split("a,b,c", ",")
  • Find

    Text
    Find(find, within, [start])

    Returns the position of some text, or blank if it is not found.

    Find("@", txtEmail.Text)
  • StartsWith

    Text
    StartsWith(text, start)

    True when a text begins with the given value.

    StartsWith(Title, txtSearch.Text)
  • IsMatch

    Text
    IsMatch(text, pattern, [options])

    Checks a text against a pattern or regular expression.

    IsMatch(txtEmail.Text, Match.Email)
  • Value

    Text
    Value(text, [language])

    Converts text to a number.

    Value("42.5")
  • Today

    Date & Time
    Today()

    Current date without a time.

    Today()
  • Now

    Date & Time
    Now()

    Current date and time.

    Now()
  • Date

    Date & Time
    Date(year, month, day)

    Builds a date from its parts.

    Date(2026, 12, 31)
  • DateAdd

    Date & Time
    DateAdd(date, number, [unit])

    Adds days, months or other units to a date.

    DateAdd(Today(), 7, TimeUnit.Days)
  • DateDiff

    Date & Time
    DateDiff(start, end, [unit])

    Counts the units between two dates.

    DateDiff(StartDate, EndDate, TimeUnit.Days)
  • EOMonth

    Date & Time
    EOMonth(date, months)

    Returns the last day of a month.

    EOMonth(Today(), 0)
  • Sum

    Math
    Sum(table, formula)

    Adds up a column or a list of numbers.

    Sum(colOrders, Amount)
  • Average

    Math
    Average(table, formula)

    Averages a column or a list of numbers.

    Average(colOrders, Amount)
  • Max

    Math
    Max(table, formula)

    Finds the largest value.

    Max(colOrders, Amount)
  • Round

    Math
    Round(number, digits)

    Rounds a number to the given number of decimals.

    Round(3.14159, 2)
  • Filter

    Tables
    Filter(table, condition, [...])

    Returns the rows that match every condition.

    Filter(Tasks, Status = "Open")
  • LookUp

    Tables
    LookUp(table, condition, [result])

    Finds the first row that matches a condition.

    LookUp(Users, ID = 5, Email)
  • Sort

    Tables
    Sort(table, formula, [order])

    Sorts a table by a formula.

    Sort(Tasks, DueDate, SortOrder.Ascending)
  • SortByColumns

    Tables
    SortByColumns(table, column, [order, ...])

    Sorts a table by one or more column names.

    SortByColumns(Tasks, "Priority", SortOrder.Descending)
  • FirstN

    Tables
    FirstN(table, [count])

    Returns the first rows of a table.

    FirstN(Tasks, 10)
  • CountRows

    Tables
    CountRows(table)

    Counts the rows in a table.

    CountRows(Filter(Tasks, Done))
  • Distinct

    Tables
    Distinct(table, formula)

    Returns the unique values of a column.

    Distinct(Tasks, Category)
  • AddColumns

    Tables
    AddColumns(table, name, formula, [...])

    Adds calculated columns to a table.

    AddColumns(Users, "Full", First & " " & Last)
  • GroupBy

    Tables
    GroupBy(table, column, [...], groupName)

    Groups rows by one or more columns.

    GroupBy(Tasks, "Owner", "Rows")
  • ForAll

    Tables
    ForAll(table, formula)

    Runs a formula for every row of a table.

    ForAll(colCart, Patch(Orders, Defaults(Orders), {Item: Item}))
  • Patch

    Data
    Patch(source, record, changes, [...])

    Creates or updates a record in a data source.

    Patch(Tasks, Defaults(Tasks), {Title: "New"})
  • Collect

    Data
    Collect(collection, item, [...])

    Adds records to a collection.

    Collect(colCart, {Item: "Pen", Qty: 2})
  • ClearCollect

    Data
    ClearCollect(collection, item, [...])

    Empties a collection, then fills it with new data.

    ClearCollect(colOpen, Filter(Tasks, Status = "Open"))
  • Clear

    Data
    Clear(collection)

    Removes all records from a collection.

    Clear(colCart)
  • RemoveIf

    Data
    RemoveIf(source, condition, [...])

    Deletes the records that match a condition.

    RemoveIf(colCart, Qty <= 0)
  • SaveData

    Data
    SaveData(collection, name)

    Saves a collection to the device storage.

    SaveData(colCart, "cart")
  • Set

    App
    Set(name, value)

    Sets a global variable.

    Set(gblUser, User().Email)
  • UpdateContext

    App
    UpdateContext({ name: value })

    Sets screen-level context variables.

    UpdateContext({locOpen: true})
  • Notify

    App
    Notify(message, [type], [timeout])

    Shows a banner message to the user.

    Notify("Saved", NotificationType.Success)
  • SubmitForm

    App
    SubmitForm(form)

    Saves the data in an edit form.

    SubmitForm(frmTask)
  • Concurrent

    App
    Concurrent(formula1, formula2, [...])

    Runs several formulas at the same time.

    Concurrent(ClearCollect(colA, A), ClearCollect(colB, B))
  • SetFocus

    App
    SetFocus(control)

    Moves keyboard focus to a control.

    SetFocus(txtName)
  • RGBA

    App
    RGBA(red, green, blue, alpha)

    Builds a color from its parts.

    RGBA(116, 39, 116, 1)
  • JSON

    App
    JSON(data, [format])

    Turns a table or record into JSON text.

    JSON(colCart, JSONFormat.IndentFour)
  • ParseJSON

    App
    ParseJSON(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

  1. Type a function name, or a word such as filter, date or collection, into the search box.
  2. Pick a category button, such as Tables or Data, to narrow the list.
  3. Read the syntax line. Arguments in square brackets are optional, and [...] means you can repeat the argument.
  4. 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.
  5. 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.

Related tools