Formulas and functions in PowerTable

Planning sheet supports more than 100 formulas and functions, including logical, conditional, mathematical, text, date, and lookup functions. PowerTable supports a subset of these formulas and a few more, with over 50 formulas available.

In PowerTable, you can use formulas when creating a formula column or configuring data-derived default values.

Formula column#

Add formula columns to your PowerTable app to perform calculations without writing complex code. You can add formula columns at the visual level or directly to the database through the PowerTable app.

When you add a formula column, enter the required formula in the formula editor. As you type, the editor provides suggestions and autocomplete options to help you create and troubleshoot formulas.

You can also use Ctrl + Space to manually open the suggestions pop-up.

  • Select the Reference tab to add column names to the formula.
  • Select the Functions tab to view the list of supported functions. Select one to view its syntax and example and then insert it.

A formula can contain the following elements:

  • References: Column names that contain values. For example, [Name] ,[Cost] , and such.
  • Expressions: References combined with logical or mathematical operators to define an operation. For example, (([Actuals]-[Plan])/[Plan]) > 0.2 .
  • Constants: Values or numbers that don't change.
  • Functions: Predefined operations that accept one or more expressions and values and return a result. Each function has a specific keyword and syntax. Example: IF([Age]>50,"Senior","Junior") .
  • Nested functions: Multiple functions combined within a single formula. Example: IF((AND([Age]>50),([Gender]=="F")),0.5,0.2) .

Don't attempt to copy and paste the formulas from the preceding section.

Copy-pasting a formula isn't supported. PowerTable resolves column references as you type, and pasted text doesn't preserve those references.

Type the formula manually, use Ctrl+Space and then under References tab, select the reference to insert each column reference instead of typing the bracketed column name as plain text.

For more information about adding and configuring a formula column, see Insert formula column.

Default values

Default values automatically populate columns with predefined data when no value is provided. You can enter a static value or configure a formula to create a dynamic default value based on existing data.

For more information, see Default values using formulas.

PowerTable formulas can be classified into:

Following are the supported formulas and functions in PowerTable. Navigate to the links for detailed examples.

Conditional statements#

Conditional statements evaluate expressions and return different values depending on whether the conditions are true or false.

FormulaDescription
IFReturns one value if a condition is true and another value if it is false.
IFNAReturns the specified value if an expression results in the #N/A error; otherwise, it returns the result of that expression.
SWITCHEvaluates an expression against a list of values and returns the result corresponding to the first matching value. If no match is found, an optional default value is returned.

Logical functions#

Apply logical functions to test conditions and return TRUE or FALSE results. These functions are often used along with the IF function and other conditional functions to evaluate multiple criteria.

FormulaDescription
ANDReturns TRUE only if all specified conditions are TRUE. If any condition evaluates to FALSE, the function returns FALSE. It is commonly used with IF and other conditional functions to evaluate multiple criteria.
INReturns TRUE if a specified value matches any value in a list or array. It returns FALSE if no match is found.
ISBLANKReturns TRUE if the specified value is blank or empty. It returns FALSE if the value contains any text, number, or expression.
ISEMPTYSame as ISBLANK.
ISNUMBERReturns TRUE if the specified value is a valid number. It returns FALSE if the value is not numeric.
NOTReturns the opposite of a logical value. It returns TRUE if the specified condition is FALSE, and FALSE if the condition is TRUE.
ORReturns TRUE if at least one of the specified conditions is TRUE. It returns FALSE only when all conditions evaluate to FALSE.
XORReturns TRUE if exactly one or an odd number of the specified conditions is TRUE. Otherwise, it returns FALSE.

Math functions#

FormulaDescription
ABSReturns the absolute value of a number, which represents the number’s magnitude without considering its sign.
AVERAGEReturns the average (arithmetic mean) of a set of values.
AVERAGEEXNEGReturns the average (arithmetic mean) of a set of values while excluding negative numbers from the calculation.
AVERAGEEXZEROReturns the average (arithmetic mean) of a set of values while excluding the zero values from the calculation.
AVERAGEEXZERONEGReturns the average (arithmetic mean) of a set of values while excluding both zero and negative numbers from the calculation.
CEILINGRounds a number up to the nearest integer or specified multiple (significance).
DIVIDEReturns the result of dividing one number by another.
EVENRounds a number up to the nearest even integer.
EXPReturns the value of the mathematical constant e raised to the power of a specified number.
FLOORRounds a number toward zero to the nearest specified multiple of significance.
INDEXOFReturns the index of the first occurrence of a specified value within a list of values.
LOGReturns the logarithm of a number using a specified base.
MAXReturns the largest number from a set of values.
MEDIANReturns the middle value in a set of numbers arranged in ascending order.
MINReturns the smallest number from a set of values.
MODDivides one number by another and returns the remainder of the division.
NUMBERVALUEConverts text into a numeric value by interpreting decimal and thousands separators, such as commas and periods.
ODDRounds a number up and returns the nearest higher odd integer.
PCTPerforms percentage calculations by converting a numeric value into its percentage equivalent.
POWReturns the result of a number raised to a specified power.
RANDReturns a random decimal number between 0 and 1.
RANDBETWEENReturns a random integer between two specified values.
ROUNDRounds a number to a specified number of decimal places.
SUMReturns the total of all numbers provided in the arguments.
SQRTReturns the square root of a given number.

Text formatting functions#

FormulasDescription
CONCATENATEJoins two or more text strings into a single text string.
FINDReturns the position of the first occurrence of a sub-string within a text string.
LEFTReturns the specified number of characters from the beginning of a text string.
LENReturns the total number of characters in a text string, including letters, numbers, spaces, and special characters.
LOWERConverts all characters in a text string to lowercase.
MIDReturns a specified number of characters from a text string, starting at the position you specify.
REPLACEReplaces part of a text string with another text value based on the specified position and length.
REPTRepeats a text string a specified number of times.
RIGHTReturns the specified number of characters from the end of a text string.
TEXTConverts a value into formatted text based on the specified format string.
TRIMRemoves leading and trailing spaces from a text string while retaining spaces between words.
UPPERConverts all characters in a text string to uppercase.
VALUEConverts a text string that represents a number into a numeric value.

Date functions#

FormulasDescription
DATEADDAdds or subtracts a specified interval from a date value.
DATEDIFFReturns the number of days between two dates.
DATEConverts a date value into the specified format.
DAYExtracts the day value from a date.
EOMONTHReturns the end date of the month for a given date.
FROMEXCELDATEConverts an Excel serial date number into its equivalent date value.
MONTHExtracts the month value from a date.
NOWThe DATE.NOW function returns the current date and time based on the system settings.
TODAYReturns the current date.
YEARExtracts the year from a date.

Identifiers#

FormulasDescription
HASChecks whether the specified value exists in one or more columns. This function is commonly used with visual columns, such as Single Select and Multi-select.
HAS_SOMEChecks whether one or more of the specified values exist in one or more columns.
MATCHChecks whether the specified value exactly matches the value in a column.
BLANKReturns a blank value. Use this in formula to insert a blank or check for blank values.
COLUMN_COUNTReturns total number of column items in the table.

Other operators#

For the list of operators supported, see Other operators.

Fabric Plan
Enterprise planning, integrated with PowerTable and Intelligence, native to Microsoft Fabric. Co-engineered with Lumel.
BUILT ON MICROSOFT FABRIC
CERTIFIED BY
Fabric Planning is certified by IBCS
Microsoft, Azure, Copilot, Excel, Fabric IQ, Microsoft Entra, Microsoft Fabric, Microsoft Teams, OneLake, Outlook, Power Automate, Power BI and SharePoint are trademarks of the Microsoft group of companies. IBCS is a registered trademark of IBCS Association. All other trademarks are the property of their respective owners.

This community is operated independently by Lumel. Nothing on this site constitutes a representation or warranty by Microsoft.