Introduction
When building Power Apps, there are many scenarios where you need to display additional information without modifying your original data source. For example, you may want to calculate the total price of an order, display a customer's full name, or create a custom status based on business rules.
Instead of adding extra columns to your SharePoint list or Dataverse table, Power Apps provides the AddColumns() function, which lets you create calculated columns dynamically at runtime.
In this article, you'll learn how to use AddColumns() with practical examples, understand its benefits, and explore best practices for building efficient Power Apps.
What is AddColumns()?
The AddColumns() function creates a new table by adding one or more calculated columns to an existing table or collection. The new columns exist only while the app is running, so the original data source remains unchanged.
Syntax
AddColumns(
Table,
ColumnName,
Formula
)
Parameters
| Parameter | Description |
|---|
| Table | The table or collection to extend. |
| ColumnName | Name of the new calculated column. |
| Formula | Formula used to calculate the value for each record. |
Why Use AddColumns()?
Using AddColumns() offers several advantages:
Add calculated columns without changing your data source.
Simplify formulas in galleries and data tables.
Display dynamic business information.
Improve app readability and maintenance.
Create multiple calculated columns in a single function.
Sample Data
Assume we have an Orders SharePoint list.
| OrderID | Customer | Quantity | UnitPrice |
|---|
| 1001 | Ketan | 2 | 500 |
| 1002 | Vimal | 5 | 250 |
| 1003 | Mitesh | 8 | 150 |
Example 1: Calculate Total Price
Suppose you want to display the total amount for each order without creating a new SharePoint column.
AddColumns(
Orders,
TotalPrice,
Quantity * UnitPrice
)
Output
| Customer | Quantity | UnitPrice | TotalPrice |
|---|
| Ketan | 2 | 500 | 1000 |
| Vimal | 5 | 250 | 1250 |
| Mitesh | 8 | 150 | 1200 |
Example 2: Create an Order Status
You can dynamically create a status column based on the order quantity.
AddColumns(
Orders,
OrderStatus,
If(
Quantity >= 5,
"Bulk Order",
"Regular Order"
)
)
Output
| Customer | Quantity | OrderStatus |
|---|
| Ketan | 2 | Regular Order |
| Vimal | 5 | Bulk Order |
| Mitesh | 8 | Bulk Order |
Example 3: Add Customer Category
Let's classify customers based on their purchase quantity.
AddColumns(
Orders,
CustomerCategory,
If(
Quantity >= 5,
"Premium",
"Standard"
)
)
Output
| Customer | Category |
|---|
| Ketan | Standard |
| Vimal | Premium |
| Mitesh | Premium |
Example 4: Add Multiple Columns
You can create more than one calculated column in a single function.
AddColumns(
Orders,
TotalPrice,
Quantity * UnitPrice,
Discount,
Quantity * UnitPrice * 0.10,
FinalPrice,
Quantity * UnitPrice * 0.90
)
Output
| Customer | TotalPrice | Discount | FinalPrice |
|---|
| Ketan | 1000 | 100 | 900 |
| Vimal | 1250 | 125 | 1125 |
| Mitesh | 1200 | 120 | 1080 |
Using AddColumns() in a Gallery
Set the Items property of your Gallery.
AddColumns(
Orders,
TotalPrice,
Quantity * UnitPrice
)
Now add a label inside the Gallery and set its Text property to:
ThisItem.TotalPrice
The gallery will automatically display the calculated value.
Combining AddColumns() with Filter()
Display only customers whose order quantity is 5 or greater.
AddColumns(
Filter(
Orders,
Quantity >= 5
),
TotalPrice,
Quantity * UnitPrice
)
Output:
| Customer | Quantity | TotalPrice |
|---|
| Vimal | 5 | 1250 |
| Mitesh | 8 | 1200 |
![Add Column()]()
Real-World Use Cases
Invoice Processing
Calculate invoice line totals before submission.
Employee Directory
Display employee full names without storing another column.
Sales Dashboard
Calculate commissions, incentives, or bonuses dynamically.
Inventory Management
Calculate stock values using Quantity × Unit Cost.
Reporting
Create calculated KPIs for dashboards without modifying the data source.
Common Mistakes
Expecting AddColumns() to save values back to SharePoint.
Ignoring delegation warnings for large data sources.
Repeating the same calculation across multiple controls instead of using AddColumns() once.
Conclusion
The AddColumns() function is one of the most powerful Power Fx functions for shaping data in Power Apps. It allows you to add calculated columns dynamically, making your apps cleaner, more efficient, and easier to maintain. Whether you're calculating totals, assigning statuses, or preparing data for reports, AddColumns() helps you deliver a better user experience without modifying the underlying data source.
By combining AddColumns() with functions such as Filter(), Sort(), and Search(), you can build scalable and responsive applications while keeping your formulas simple and maintainable