Power BI Sum Multiple columns

In this Power BI Tutorial, we will learn about the Power BI SUM multiple columns with a few examples. We will also see how to filter, sum, and group by the various columns in Power BI.

  1. Power BI sum Multiple columns
  2. How to sum multiple columns in Power Bi
  3. Power BI sum Multiple columns with filter
  4. Power BI sum Multiple columns in a Matrix
  5. Power BI sum group by Multiple columns
  6. Power BI sum group by Multiple columns with filter
  7. Power BI sum Multiple columns from different tables
  8. Power BI sum multiple columns in a table
  9. Power Bi sum multiple columns yes or no
  10. Power BI sum multiple columns percentage
  11. Power BI cumulative sum by multiple columns
  12. Power Query list sum multiple columns
  13. Power BI sum multiple columns zero
  14. Power BI running total multiple columns
  15. Power BI sum multiple columns unique

Power BI sum Multiple columns

To Sum Multiple columns in Power BI, we use the SUM() or SUMX() function in Power BI,

  • The Power BI Sum() function will add all the numbers in a column-based manner, it calculates or Sums the values column-wise and returns the value.
  • The syntax for the Power BI SUM() Function is mentioned below:
Sum= SUM(<column>)
  • The Power BI SUMX() function returns the sum value for each row in a table, The power BI SUMX() function takes the first argument of a table and the second argument of the function is an expression, that contains the number you want to sum.
  • The syntax for the Power BI Dax SUMX() function is shown below:
Sumx = SUMX(<table>,<expression>)

Now in the below heading, we will see how to sum multiple columns in Power BI. Here In this example, I have used this excel file data.

How to sum multiple columns in Power BI

Let us see how to sum multiple columns using the SUMX function in Power BI,

  • In this example, I have used the below sample table (Product) to calculate or sum the multiple columns (SP and CP) using the sum function in the Power BI measure.
How to sum multiple columns in Power BI
How to sum multiple columns in Power BI
  • Make sure you have Loaded the data using the get data option on the Power BI desktop. Now, click on the New measure from the ribbon and apply the below-mentioned formula:
SUM of SP and CP = SUMX(Products, Products[SP]+Products[CP])

Where,

  1. SUM of SP and CP =Measure Name
  2. Products = Table Name
  3. SP,CP = Column names (Number data type)
  • Once the Measure is created drag and drop the created measure in the value field.
  • In the below screenshot, you can see that it displays the sum value using the SUMX function of multiple columns in Power BI.
How to sum two columns in Power BI
How to sum two columns in Power BI

This is how to sum multiple columns using the SUMX function in Power BI.

Also, read: Power BI divides two columns [With Examples]

Power BI sum Multiple columns with filter

Let us see how to sum multiple columns with a filter using the SUMX function in Power BI,

  • In this example, I have used the below sample table (Product) to calculate or sum the multiple columns using the sum function in the Power BI measure.
How to sum multiple columns in Power BI
How to sum multiple columns in Power BI
  • First, we will calculate the total of SP and CP, after that we will apply a filter for Product A.
  • Initially Load the data using the Get data option and click on the new measure from the ribbon. Then apply the below-mentioned measures.
SUM of SP and CP = SUMX(Products, Products[SP]+Products[CP])
Filter = SUMX( FILTER(Products, Products[Product]="Product A"), [SUM of SP and CP])

Where,

  1. SUM of SP and CP =Measure Name
  2. Products = Table Name
  3. SP, CP = Column names
  • Once the Measure is created drag and drop the created measure in the value field.
  • In the below screenshot you can see the Sum of the value is calculated and based on the filter it displays the Product A value in the card visual.
Power BI sum Multiple columns with filter example
Power BI sum Multiple columns with filter example

This is how to sum multiple columns with a filter using the SUMX function in Power BI.

Check out: Stacked Bar Chart in Power BI [With 27 Real Examples]

Power BI sum Multiple columns in a Matrix

Let us see how we can sum multiple columns using the SUM function in Power BI and display the result in the matrix visual,

  • In this example, I have used the below sample table to calculate or sum the multiple columns using the sum function in the Power BI measure.
Power BI sum Multiple columns in a Matrix
Power BI sum Multiple columns in a Matrix
  • Here, we will calculate the total value of SP and CP using the SUM function measure in Power BI.
  • Initially Load the data using the get data option and click on the new measure from the ribbon. Then apply the below-mentioned measures using the SUM function.
  • When we use the SUM function, by default it takes the column count value, To solve this problem we can use the CALCULATE() function as shown below:
SUM of SP and CP = CALCULATE(SUM(Products[SP])+SUM(Products[CP]))

Where,

  1. SUM of SP and CP =Measure Name
  2. Products = Table Name
  3. SP, CP = Column names
  • Once the Measure is created drag and drop the created measure in the value field.
  • Now select the matrix visual under the visualizations, and drag and drop the field that you want to display in it.
Power BI sum Multiple columns in a Matrix example
Power BI sum Multiple columns in a Matrix example
  • In the below screenshot, you can see the Sum value is displayed in the Matrix visual using the SUM function.
Power BI sum Multiple columns in the Matrix example
Power BI sum Multiple columns in the Matrix example

This is how to sum multiple columns using the SUM function in Power BI and display the result in the matrix visual.

Read: Power BI Bookmarks [With 21 Examples]

Power BI sum group by Multiple columns

Let us see how we can sum and group by Multiple columns in Power BI.

For example, here we will use the below table to sum and group the Sales based on the Product and Country.

Power BI sum group by Multiple columns
Power BI sum group by Multiple columns
  • In the Power BI desktop click on the Transform Data from the ribbon, to open the power query editor.
Power BI sum group by Multiple column
Power BI sum group by Multiple columns
  • In the power query editor, Click on Transform tab -> Group by. click on Group By icon from the ribbon.
Power BI sum group by Multiple columns example
Power BI sum group by Multiple columns example
  • Then the Group By window will appear, Click on the Advanced options, -> choose the Country column -> click on Add grouping -> the select Product column.
  • Next, enter the new column name, select Operation as Sum, and select the Column as Sales. Then click on the OK button.
Power BI sum group by the Multiple columns
Power BI sum group by the Multiple columns
  • Now, we can see the original table getting replaced with Group By table, having three columns i.e Country, Product, and Total Sales.
Power BI sum group by the Multiple columns example
Power BI sum group by the Multiple columns example

This is how to sum and group by Multiple columns in Power BI.

Also read: Clustered Column Chart in Power BI [With 45 Real Examples]

Power BI sum group by Multiple columns with filter

Let us see how we can sum and group by the Multiple columns with a filter in Power BI,

For example, here we will use the below table to sum and group the Sales based on the Product and Country.

Power BI sum group by Multiple columns with filter
Power BI sum group by Multiple columns with filter
  • In the Power BI desktop click on the New Table under the table tools from the ribbon as highlighted below:
Power BI sum group by Multiple columns with filter example
Power BI sum group by Multiple columns with filter example
  • Then write the below-mentioned DAX formula in Power BI.
Total Sales = SUMMARIZE(Sales,Sales[Product],"Country", CONCATENATEX(Sales,Sales[Country],","), "Sales",SUM(Sales[Sales]))

Where,

  1. Total Sales = New Table Name
  2. Sales = Existing Table Name
  3. Product, Country, Sales = Column names
  • Now, below the screenshot, you can see that the New Total sales table displays the data with Group By table, having three columns i.e Country, Product, and Sales.
Example of Power BI sum group by Multiple columns with filter
Example of Power BI sum group by Multiple columns with filter
  • In the Total Sales table, Click on the new measure from the ribbon. Then apply the below-mentioned measures to apply a filter based on the product.
GroupbyFilter = SUMX( FILTER('Total Sales', 'Total Sales'[Product]="VTT"),'Total Sales'[Sales])

Where,

  1. Total Sales = Newly created Table Name
  2. Sales = Existing Table Name
  3. Product, Country, Sales = Column names
  • Once the Measure is created drag and drop the created measure in the value field.
  • In the below screenshot, you can see the Sales value is displayed in the card visual.
  • Based on the filter applied it displays the Product VTT sales value in the card visual.
Example of the Power BI sum group by Multiple columns with filter
Example of the Power BI sum group by Multiple columns with filter

This is how to sum and group by the multiple columns with a filter using the SUMX and Filter function in Power BI.

Read: Power bi change color based on value [With 13 real examples]

Power BI sum Multiple columns from different tables

Let us see how we can sum up multiple columns from different tables and display the value in Power BI.

Here in this example, I have selected two different tables of data as shown below and we have two tables in which each table has one column common i.e Product column as common.

Table – 1: (Sales Table)

Power BI sum Multiple columns from different tables
Power BI sum Multiple columns from different tables

Table – 2: (Profit Table)

Power BI sum two columns from different tables
Power BI sum two columns from different tables

First, we will sum the Sales Colum in Sales Table with the Profit column in Profit Table according to Product.

  • Initially load the data using the get data option to the Power BI desktop, Now click on the new measure from the ribbon and then write the below measure:
SUM of Sales and Profit = SUMX(Sales,Sales[Sales Column]) + SUMX(Profit,Profit[Profit Column])

Where,

  1. SUM of Sales and Profit = Measure Name
  2. Sales, Profit = Existing Table Names
  3. Sales Column, Profit Column = Column names
  • Check the measure, and select the table visual from the visualization pane.
  • In the value field, drag and drop the Product, Country, Sales column, Profit column, and Sum of Sales and Profit measure from the field pane.
Power BI sum two columns from different tables example
Power BI sum two columns from different tables example
  • In the below screenshot, you can see that Power BI sum up the multiple columns from the two different columns in Power BI.
Example of Power BI sum two columns from different tables
Example of Power BI sum two columns from different tables

This is how, to sum up, multiple columns from different tables and display the value in Power BI.

Power BI sum multiple columns in a table

Let us see how we can sum multiple columns in a table Power BI,

In this example, I have used the below sample table to calculate or sum the multiple columns using the sum function in the Power BI measure.

Power BI sum multiple columns in a table
Power BI sum multiple columns in a table
  • Make sure you have Loaded the data using the get data option on the Power BI desktop. Now, click on the new measure from the ribbon and apply the below-mentioned formula
SUM of SP and CP = CALCULATE(SUM(Products[SP])+SUM(Products[CP]))

Where,

  1. SUM of SP and CP =Measure Name
  2. Products = Table Name
  3. SP, CP = Column names
  • Once the Measure is created drag and drop the created measure in the value field.
  • Now, select the table visual under the visualizations, and under the column, drag and drop the fields that you want to display in the Table visual.
  • It displays the sum value using the SUM function of multiple columns in Table Power BI.
Power BI sum multiple columns in a table example
Power BI sum multiple columns in a table example

In the below screenshot, you can see that the sum of multiple columns in a table is calculated and displayed in the Table visual.

Example of Power BI sum multiple columns in a table
Example of Power BI sum multiple columns in a table

This is how to sum multiple columns in a table using the SUM function in Power BI.

Also, check out this post: Power BI calculated column [With 71 Useful Examples]

Power Bi sum multiple columns yes or no

Let us see how we can create a SUM measure with conditions in Power BI.

For example, here we have created a sample data having Products, Country, sales, and Profit as shown below:

Power Bi sum multiple columns yes or no
Power Bi sum multiple columns yes or no
  • Now we will create a measure and apply the formula, if the Sales count is greater than 1200 then it should display the value Yes else it should display the value No.
Sum_if = IF(SUM(Profit[Sales]) >= 1200, "Yes", "No")

Where,

  1. Sum_if = Measure Name.
  2. Profit = Table name
  3. Sales = Column name
  • Once the Measure is created drag and drop the created measure in the value field.
  • Select the Table or Matrix visual under the visualizations, and drag and drop the column fields that you want to display in the visual.
Power Bi sum multiple columns yes or no example
Power Bi sum multiple columns yes or no example
  • In the below screenshot, you can see that it displays the Yes / No value using the SUM function of multiple columns in Power BI. If the Sales value is greater than 1200 then it displays a yes value else it displays no value.
Power Bi sum multiple columns yes or no value
Power Bi sum multiple columns yes or no value

This is how to create a SUM measure with conditions in Power BI.

Check out: Power BI if date + 27 Examples

Power BI sum multiple columns percentage

Let us see how we can sum multiple columns Percentage in Power BI,

In this example, I have used the below sample table to calculate or sum the multiple columns using the sum function in the Power BI measure.

Power BI sum multiple columns percentage
Power BI sum multiple columns percentage
  • Make sure you have Loaded the data using the get data option on the Power BI desktop. Now, click on the new measure from the ribbon and apply the below-mentioned formula
Measure3 = SUM(Products[SP+CP])
SP+CP/CP = [Measure3]/Products[Sum of CP Column]

Where,

  1. Measure3 and SP+CP/CP = Measures Name
  2. Products = Table Name
  3. SP and CP = Column names
  • Once the Measure is created drag and drop the created measure in the value field.
  • Select the Table or Matrix visual under the visualizations, and drag and drop the column fields that you want to display in the visual.
  • Make sure, you have selected the measure and changed the data type format from Wholenumber to Percentage.
  • In the below screenshot, you can see that it displays the percentage value using the SUM function of multiple columns in Power BI.
Power BI sum multiple columns percentage example
Power BI sum multiple columns percentage example

This is how to sum multiple columns and display the Percentage value in Power BI.

Also read: Power BI IF + 31 Examples

Power BI cumulative sum by multiple columns

Let us see how we can sum the cumulative sum by multiple columns in Power BI,

  • In this example, I have used the below sample table to calculate the cumulative sum of the multiple columns using the sum function in the Power BI measure.
power bi cumulative sum by multiple columns
power bi cumulative sum by multiple columns
  • Here, we will calculate the total value of SP and CP using the SUM function measure in Power BI.
  • Initially Load the data using the get data option and click on the new measure from the ribbon. Then apply the below-mentioned measures using the SUM function.
  • When we use the SUM function, by default it takes the column count value, To solve this problem we can use the CALCULATE() function as shown below:
Cumulative Sum = CALCULATE(SUM(Products[SP])+SUM(Products[CP]))
  1. Cumulative Sum =Measure Name
  2. Products = Table Name
  3. SP, CP = Column names
  • Once the Measure is created drag and drop the created measure in the value field.
  • Now select the matrix or table visual under the visualizations, and drag and drop the field that you want to display in it.
power bi cumulative sum by multiple columns example
power bi cumulative sum by multiple columns example
  • In the below screenshot, you can see the Sum value is displayed in the visual using the Cumulative SUM function.
power bi cumulative sum by multiple column
power bi cumulative sum by multiple columns

This is how to sum the cumulative sum by multiple columns in Power BI.

Read: Power Query Examples

Power Query list sum multiple columns

Let us see how we can sum the two or more column list using Power Query in Power BI,

In this example, I have used the below sample table to sum the two columns using the Power Query editor in Power BI.

Power Query list sum multiple columns
Power Query list sum multiple columns
  • Here, we will calculate the sum of sales and profit value using the power query editor in Power BI.
  • Initially Load the data using the get data option and click on the Home and Select the Transform data option from the ribbon as shown below:
Power Query sum multiple columns
Power Query sum multiple columns
  • Now, In the Power Query editor, Select the Table and click on the add column option.
  • After that, select the column that you want to add with other columns Expand the standard option and select the operation that you want to perform.
  • Here I am going to select Add operation as mentioned below:
Power Query sum multiple columns in Power BI
Power Query sum multiple columns in Power BI
  • Under the values, select the columns that you want to add, and click on the Ok button.
Power Query sum multiple columns in the Power BI
Power Query sum multiple columns in the Power BI
  • Now, you can see the Addition column displays the result of sales + profit columns using Power Query in Power BI.
  • Click on the Close and Apply option from the ribbon, so that the changes will be saved.
Power Query sum multiple columns in the Power BI example
Power Query sum multiple columns in the Power BI example

This is how, to sum up, the two or more column lists using Power Query in Power BI.

Check: Power BI split column [With 13 real examples]

Power BI sum multiple columns zero

Let us see how we can sum two columns and display the result in integers in Power BI,

  • yes, it is possible to display the calculated result in the integer format, where the result value is greater than 1 then it displays the value 1 else it displays the value 0.
  • In this example, I have used the below sample table to calculate or sum the multiple columns using the sum function and display the result in the integer format using the Power BI measure.
Power BI sum multiple columns zero
Power BI sum multiple columns zero
  • Make sure you have Loaded the data using the get data option on the Power BI desktop. Now, click on the new measure from the ribbon and apply the below-mentioned formula
Measure = IF(SUM(Profit[Sales]) + SUM(Profit[Profit]) > 1, 1, 0)

Where,

  1. Measure = Measure Name
  2. Profit= Table Name
  3. Sales and Profit = Column names
  • Now, below the screenshot, you can see that the New Measure displays the data with Group By table, having four columns i.e Country, Product, Sales, and Profit.
  • After selecting the created measure that you have displayed in the table it will display the integer value if the sum value is greater than 1 then it displays 1 else 0.
Power BI sum multiple columns zero example
Power BI sum multiple columns zero example
  • In the below screenshot, you can see the Measure value is displayed based on the sum value of profit and sale in the table visual.
Power BI sum multiple columns with zero
Power BI sum multiple columns with zero

This is how to sum two columns and display the result in an integer.

Read: How to create a report in Power BI Desktop? [Excel & SharePoint]

Power BI running total multiple columns

Let us see how we can calculate the running total of the Multiple columns using the Power BI measure,

  • In this example, I have used the below sample table to calculate the running total of multiple columns in Power BI.
Power BI running total multiple columns
Power BI running total multiple columns
  • Make sure you have Loaded the data using the get data option on the Power BI desktop. Now, click on the new measure from the ribbon and apply the below-mentioned formula
Running total = CALCULATE( SUM(Profit[Sales]),
		Profit[Sales] >= (Profit[Profit])
	   )

Where,

  1. Running total = Measure Name
  2. Profit = Table Name
  3. Sales and Profit = Column names
  • Now, below the screenshot, you can see that the New measure displays the data with Group By table, having four columns i.e Country, Product, Sales, Profit, and Running total.
  • After selecting the created measure that you have displayed in the table it will display the result based on the condition applied in the Measure.
Power BI running total multiple columns example
Power BI running total multiple columns example
  • In the below screenshot, you can see the Measure value is displayed as the running total value when the sales value is greater than the profit value.
Power BI running total multiple column example
Power BI running total multiple column example

This is how to calculate the running total of the Multiple columns using the Power BI measure.

Also, check: Power BI Date Slicer [With 41 real examples]

Power BI sum multiple columns unique

Let us see how we can display the sum of multiple column unique values in Power BI,

  • In this example, I have used the below sample table to calculate the uniqueness of multiple columns in Power BI.
Power BI sum multiple columns unique
Power BI sum multiple columns unique
  • Make sure you have Loaded the data using the get data option on the Power BI desktop. Now, click on the new measure from the ribbon and apply the below-mentioned formula
Unique value count = 
VAR totalcount =
    FILTER (
        SUMMARIZE (
            UNION (
                VALUES ( Profit[Product] ),
                VALUES ( Profit[Country] )
            ),
            Profit[Product]
        ),
        Profit[Product]<> BLANK ()
    )
RETURN
    COUNTROWS ( Unique value count)

Where,

  1. Unique value count = Measure Name
  2. var totalcount = variable name
  3. Profit = Table Name
  4. Country and Product = Column names
  • Now, below the screenshot, you can see that the New measure displays the data with Group By table, having four columns i.e Country, Product.
  • Drag and drop the created measure that you have created in the card visual it will display the result based on the condition applied in the Measure.
Power BI sum distinct multiple columns
Power BI sum distinct multiple columns
  • In the below screenshot, you can see the Measure value is displayed the unique value of product and country column as shown below:
Power BI sum multiple columns unique example
Power BI sum multiple columns unique example

This is how to display the sum of multiple column unique values in Power BI.

Also, you may like some more below Power BI Tutorials:

In this Power BI Tutorial, we have learned how to sum two columns using the SUMX function with some examples and also covered the below-mentioned topics:

  • Power BI sum Multiple columns
  • How to sum multiple columns in Power Bi
  • Power BI sum Multiple columns with filter
  • Power BI sum Multiple columns in a Matrix
  • Power BI sum group by Multiple columns
  • Power BI sum group by Multiple columns with filter
  • Power BI sum Multiple columns from different tables
  • Power BI sum multiple columns in a table
  • Power Bi sum multiple columns yes or no
  • Power BI sum multiple columns percentage
  • Power BI cumulative sum by multiple columns
  • Power Query list sum multiple columns
  • Power BI sum multiple columns zero
  • Power BI running total multiple columns
  • Power BI sum distinct multiple columns
  • Power Bi sum multiple columns unique
>