How can I sum multiple columns in Power BI with an example? 2

How to Sum Multiple Columns in Power BI: A Step-by-Step Guide

Power BI is a powerful suite of Business Intelligence tools designed by Microsoft, enabling organizations to transform raw data into rich, interactive visualizations and actionable insights. A foundational requirement in data preparation and analysis is the ability to aggregate measures effectively. While Power BI excels at aggregating values vertically (down a column), summing values horizontally across multiple columns within the same row requires a specific approach using Data Analysis Expressions (DAX). This technique is indispensable when dealing with data schemas where metrics are spread across various descriptive fields, such as consolidating sales figures from different regions or summing scores from multiple trials.

The common aggregation function, like SUM(), typically operates on a single column. When the objective is to create a new derived column that represents the total of several existing columns for every single record, we must utilize iterative functions that establish a row context. A row context ensures that the calculation engine evaluates the formula for each individual row independently before moving to the next. This capability is essential for creating calculated columns, which store a result for every single row in the underlying data table. Mastering this specific DAX pattern is crucial for advanced Power BI users looking to optimize their data models and perform calculations in a concise and efficient manner.

Sum Multiple Columns in Power BI (With Example)


Introduction to Aggregation in Power BI

When working with relational data models in Power BI, data aggregation serves as the backbone for meaningful analysis. Users frequently need to combine figures—be it total sales, total expenses, or, as we will demonstrate, total points scored—from various transactional fields. Standard Power BI measures often default to summing values down a column across the entire dataset or within specific filtering contexts. However, summing across columns requires iterating through each row and performing the addition horizontally, often demanding the use of specialized DAX functions designed for this exact purpose.

The core challenge lies in shifting from the standard filter context, which governs how data is aggregated based on report visuals, to a specific row context. This means the calculation engine must evaluate the formula for each individual row independently. This capability is essential for creating calculated columns, which store a result for every single row in the underlying data table. We will utilize the powerful combination of CALCULATE and SUMX to establish this behavior and achieve the desired horizontal aggregation.

Why Sum Multiple Columns? Understanding the Use Case

The need to sum multiple columns often arises when data is structured in a wide format, where different metrics belonging to the same category are stored in distinct columns rather than rows. For example, monthly budgets might be split into columns labeled “Q1 Budget,” “Q2 Budget,” “Q3 Budget,” and “Q4 Budget.” To calculate the “Annual Budget,” we must aggregate these four columns horizontally for each project or department listed in the row.

This horizontal summation is crucial for quickly aggregating specific data points and gaining immediate insights without altering the fundamental structure of the source data. By creating a new calculated column, the aggregated total becomes a persistent, reusable element within the data model, ready for immediate use in visualizations, conditional formatting, and other complex calculations throughout the Power BI report environment.

Introducing the DAX Formula for Row-Level Summation

To correctly sum values across multiple columns within a single row, the most robust and commonly accepted technique involves using the iterative function SUMX within a calculated column. While one might initially attempt a simple addition of columns like [Column 1] + [Column 2], wrapping this expression within SUMX ensures proper handling of the calculation, especially when dealing with complex data types or blank values.

The following syntax in DAX allows you to sum the values across multiple columns of a table in Power BI by forcing row-by-row iteration:

Sum Points = CALCULATE(SUMX('my_data', [Game 1] + [Game 2] + [Game 3]))

This particular formula creates a new calculated column named Sum Points. It utilizes SUMX to iterate through every row of the table named my_data, evaluating the arithmetic expression [Game 1] + [Game 2] + [Game 3] for each record. The final result is a column containing the consolidated sum of the values in the Game 1, Game 2, and Game 3 columns corresponding to that specific row.

Detailed Breakdown of the SUMX Function

Understanding the mechanism of SUMX is key to mastering row-level operations in Power BI. SUMX belongs to the family of X-functions (iterators) in DAX. It requires two mandatory arguments: the table over which to iterate, and the expression to evaluate for each row of that table.

The structure SUMX(

, ) dictates that DAX first establishes a temporary row context for the specified table, which in our example is 'my_data'. For every row encountered, the expression [Game 1] + [Game 2] + [Game 3] is executed. Because this calculation occurs within the row context, the column references automatically refer to the values of those columns in the current row being processed. These individual row results are then summed up by the SUMX function itself.

It is crucial to differentiate between SUMX and the simple SUM function. SUM aggregates values down a column over the current filter context and can only take a column reference as its argument. Conversely, SUMX iterates over a table, allowing complex expressions that reference multiple columns, making it the perfect tool for calculating horizontal totals. This distinction is vital for achieving accurate horizontal aggregation.

Step-by-Step Example: Summing Player Points Data

To illustrate the practical application of this formula, let us consider a typical scenario involving sports performance data. Suppose we have imported a dataset into Power BI, named my_data, which tracks the points scored by various basketball players across three separate games. Our goal is to derive the total accumulated points for each player in a new column.

The initial data table looks like this within the Power BI environment:

In this structure, each row represents a distinct team, and the columns Game 1, Game 2, and Game 3 contain the individual numerical scores. We must calculate the horizontal sum of these three score columns for every single record to find the team’s overall performance total. This is precisely where the calculated column using SUMX becomes essential.

Implementing the New Column in Power BI

Creating a calculated column is the most straightforward method for applying this row-level summation permanently to the data model. This process is initiated directly within the Power BI desktop interface, typically from the Data view or the Modeling tab.

To begin this process, first ensure you are in the Data view with the desired table selected. Then, navigate to the ribbon. Click the Table tools tab, which contains the options necessary for modifying the structure and content of your data tables. Within this ribbon, click the New column icon.

The interface will show the location of the New column button:

Once the formula bar is active, type the following complete DAX expression. It is critical that the table name 'my_data' and the column names [Game 1], [Game 2], and [Game 3] precisely match the names used in your underlying data model:

Sum Points = CALCULATE(SUMX('my_data', [Game 1] + [Game 2] + [Game 3]))

After confirming the formula by pressing Enter, Power BI calculates the result for every row based on the defined expression, immediately generating the new column, Sum Points.

Interpreting the Results and Verification

Upon successful execution of the DAX formula, the new column, Sum Points, will be added to the my_data table. This column instantly provides the consolidated performance metric for each player, simplifying subsequent analysis and reporting efforts.

The visual output of the data table confirms the success of the horizontal aggregation:

Power BI sum multiple columns

We can verify the accuracy of the calculation by manually summing the values for a few records:

  • The Mavs player scored a total of 14 + 5 + 10 = 29 points.
  • The Spurs player accumulated 10 + 17 + 12 = 39 points.
  • The Rockets player achieved 22 + 18 + 12 = 52 points.

This derived column can now be effectively used in visualizations, filters, and cross-table relationships, providing a single, easily consumable metric representing the total scores across all games for each entity.

Conclusion and Next Steps

Aggregating values across multiple columns is a frequent requirement in data preparation, and Power BI provides the sophisticated tools necessary to achieve this via DAX. By utilizing the iterative capabilities of the SUMX function within a calculated column, analysts can efficiently create new fields that consolidate horizontal data points, as demonstrated by the basketball scoring example. This technique ensures data accuracy and significantly enhances the usability of your data model for comprehensive reporting and Business Intelligence purposes.

To continue expanding your proficiency in data modeling within Power BI, we recommend exploring tutorials on related aggregation tasks. Mastering the concepts of row context and filter context is essential for tackling more complex challenges in data preparation and measure creation.

The following tutorials explain how to perform other common tasks in Power BI:

Cite this article

stats writer (2026). How to Sum Multiple Columns in Power BI: A Step-by-Step Guide. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-sum-multiple-columns-in-power-bi-with-an-example/

stats writer. "How to Sum Multiple Columns in Power BI: A Step-by-Step Guide." PSYCHOLOGICAL SCALES, 28 Jan. 2026, https://scales.arabpsychology.com/stats/how-can-i-sum-multiple-columns-in-power-bi-with-an-example/.

stats writer. "How to Sum Multiple Columns in Power BI: A Step-by-Step Guide." PSYCHOLOGICAL SCALES, 2026. https://scales.arabpsychology.com/stats/how-can-i-sum-multiple-columns-in-power-bi-with-an-example/.

stats writer (2026) 'How to Sum Multiple Columns in Power BI: A Step-by-Step Guide', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-sum-multiple-columns-in-power-bi-with-an-example/.

[1] stats writer, "How to Sum Multiple Columns in Power BI: A Step-by-Step Guide," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, January, 2026.

stats writer. How to Sum Multiple Columns in Power BI: A Step-by-Step Guide. PSYCHOLOGICAL SCALES. 2026;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top