Add Multiple Columns Using DAX In Power BI

Overview

 
Sometimes, we need to perform “addition” operation on multiple columns by rows.
 
Let’s take an example.
 
I have two columns named “Test1” and “Test 2” in the below table.
 
Now, let’s add the columns “Test 1” and “Test 2” and make one-third of an additional column named “Total.”
 
 
We can achieve the same using Power BI DAX expressions.
 
There are two ways to achieve the same sum operation on multiple columns.
  1. Use DAX expression in a Calculated column
  2. Use DAX expression in Measure column
Based on the requirement, we can choose whether to create a calculated column or measure column.
 
Now let’s elaborate both in detail.
 
Use DAX expression in a calculated column
 
Use the following DAX expression to create a new calculated column.
 
CC Total = Sheet1[Test 1 ] + Sheet1[Test 2]
 
Here we have just performed a “+” operation between numeric fields.
 
 
Let’s check the output in table visual. Here is the result.
 
 
Use DAX expression in measure column
 
Use the following DAX expression to create a new measure column.
 
Measure Total = SUM(Sheet1[Test 1 ])+SUM(Sheet1[Test 2])
 
Let’s check the output in a table visual. Here is the result.
 
 
If we compare both the results, the output would be the same.
 
 

Conclusion

 
This is how we can add multiple columns in Power BI using DAX expression.


Similar Articles