Skip to main content
Two people working together on a computer

How to Use Formula Columns in Microsoft Dataverse

Explore how to create and use formula columns in Microsoft Dataverse.

While working in Microsoft Dynamics 365 customer relationship management (CRM) applications, you may have noticed a warning message, like the one below, when trying to create a “calculated” column. This is because Microsoft is transitioning away from traditional “calculated” columns and instituting “formula” columns. Key differences between calculated columns and formula columns in Microsoft Dataverse lie in how and when the values are computed, and what language is used to define them.

Screenshot that shows a warning message that the calculated behavior type will be discontinued. It suggests to use the new Formula data type instead.Click here to open image in a new tab

The transition from calculated columns to formula columns in Dataverse is significant for several reasons, especially for developers, data modelers, and business users working with Microsoft Power Platform and Dynamics 365.

Formula columns let you automatically calculate values in a Dataverse table using simple expressions. They work like formulas in Excel and are written using Power Fx, a user-friendly language designed for low-code development. As you type, IntelliSense (a code-completion aid from Microsoft) provides suggestions to help guide you through building your formula, making it simpler to create logic without needing traditional programming skills.

Examples of Formula Fields

  • Weighted Revenue: Estimated revenue multiplied by probability
  • Net Worth: Assets subtracted by the liabilities for a given account
  • Cost of Labor: Base rate up to 40 hours, plus additional overtime
  • Contact Number: Phone number for an opportunity based on account or contact
  • Lead Score: Single field that provides insights into the quality of a given lead
  • Follow Up By: Follow up on an activity within a specified number of days based on priority

Formula columns use the following data types:

  • Text
  • Decimal Number
  • Whole Number
  • Float
  • Boolean Choice (Yes/No)
  • Choice (formerly Option Sets)
  • DateTime

Note: The currency data type isn’t currently supported (as of 11/19/2024).

These are the operators available in a formula column:

  • Add: +
  • Subtract: -
  • Multiply: *
  • Divide: /
  • Belonging to a collection or table: in and exactin
  • String concatenation: &

There are multiple function types:

  • Decimal
  • String
  • Boolean
  • Choice
  • DateTime (TZI)
  • DateTime (User local) – limited to comparisons with other user local values, DateAdd, and DateDiff functions
  • DateTime (Date only) – limited to comparisons with other date-only values, DateAdd, and DateDiff functions
  • Currency
  • Whole Number

Adding a formula column is as simple as adding a column type in Dynamics 365. Here are the steps to follow:

  1. Sign in to Power Apps at powerapps.com and select the environment/solution you wish to use.
  1. Select “Tables” and then add/select the table into which you want to add the formula column.

Screenshot of the tables page in Power Apps.Click here to open image in a new tab

  1. Select “Columns” and then click “New column.”

Screenshot of the opportunity table in Power Apps, it highlights the columns clickable link that takes you to the columns page.Click here to open image in a new tab

Screenshot of the columns page of the opportunity table, highlighting the button that users can click to create new columns.Click here to open image in a new tab

  1. Select data type: “Formula” and enter the following information:
  • Display name
  • Formula

Screenshot of the quick create form for Columns It shows the data type of formula and an example formula, opportunity discount (Percentage) multiplied by 2.Click here to open image in a new tab

  • The “Data type” for the column will update to the relevant type after you write a formula into the text interface. Note: Once saved, the data type of a column cannot be changed.

Screenshot showing that the data type for the column cannot be changed once it has been set to the type, Formula.Click here to open image in a new tab

  1. Select any additional properties, like “Searchable,” if you want this column to be available in views, charts, dashboards, and Advanced Finds.
  1. Lastly, select “Save.”

Viewing Formula Columns on an Opportunity Record

The new formula column can be used in the same way as any other column in Dynamics 365. When added to a form, the formula column will be read-only, and display data based on the input parameters.

Screenshot of the opportunity form showing the newly created formula column.Click here to open image in a new tab

In summary, formula columns provide enhanced functionality and can be used to surface key data quickly, helping your team make informed decisions.

Now that you’ve explored how to use formula columns in Microsoft Dataverse and Dynamics 365 CRM applications, what other challenges can we help you solve?

As a top 1% Microsoft Business Applications Partner, the Microsoft team at Forvis Mazars can help you enhance your CRM system’s flexibility and performance. Connect with us today to get started on your next CRM project.

Related video: The Microsoft Power Platform Admin Center: A Guide

Related FORsights

Like what you see?
Subscribe to receive tailored insights directly to your inbox.