Formula columns in Microsoft Dataverse are calculated fields defined using Power Fx. They act as a modern alternative to the traditional calculated fields in Power Apps, improving performance in model-driven apps.

Adding a formula column

In this example, let’s create a new column named Total Price in the table called Invoice Item, which calculates the total price given the price per unit, number of units, and discount.

First, navigate to the Power Apps and create a new column.

Give it a name, and select the Data type as Formula.

choosing data type as formula

In the Formula field, enter:

(Decimal('Price Per Unit') * 'Number of Units') * (1 - ('Discount (in %)'/ 100))

You can place this field on the form, where it will appear as read-only and automatically refresh whenever any of its dependent fields change.

formula field displayed on the form

Limitations

While formula columns are a powerful feature, they do come with certain limitations.

For example, you cannot directly use currency fields and have to cast them to decimal using the decimal function, as you have seen in our example.

Also, formula columns can’t aggregate child records like sum, count, or averages across related records, which is a very common use case.

Learn more about the limitations in the official documentation.