Power BI SUM Measure

This Power BI tutorial will help you work with Power BI SUM measure.

We recently worked on a Power BI Report where the sum function helped calculate all the sales values in a data set.

In this tutorial, we will see the sum measure in Power BI and a real-time example of how to use the SUM measure in Power BI. Also, we will see how to work with Power BI sum multiple measures.

What is SUM Measure in Power BI

The SUM function adds all the numbers in a column containing the currency and numerical value in Power BI. The SUM() function returns a decimal number.

Power BI SUM function syntax:

SUM(<column>)

Where:

Column = The column name that contains the numerical values to be added.

How to use Sum Measures in Power BI

This example shows how to create an SUM measure in Power BI.

Here, we have a SharePoint list (Orders) that contains below columns with various data types:

ColumnsData Types
Order IDSingle line of text
Product NameSingle line of text
CategorySingle line of text
Sub-CategorySingle line of text
SalesCurrency
ProfitCurrency
How to Sum Measures in Power BI

Let’s create a measure in Power BI to assess the functionality of the SUM function. So, we will evaluate the total sales using SUM as a Measure in Power BI. To do this, follow the below steps.

1. Open Power BI Desktop and load the data. Then, you see data in the Data pane.

How to Sum a Measure in Power BI

2. Under the Home tab, click on the New measure.

How to get Sum of Measure value in Power BI

3. In the formula bar, click the below expression. Then click Commit.

Total Sales = SUM(Orders[Sales])

Where:

  • Total Sales = Name of the measure
  • Orders = Name of the Table
  • Sales = Name of the Column
Implement SUM measure totals in Power BI

4. Under the Home tab, expand Visual gallery(black box) -> Click the Card visual.

How to Calculate Sum of an Expression in Power BI

5. Then, using the +Add data option, add Total Sales(Measure)  into the Field in the Card visual.

Sum Measure In Power BI

6. The Card visual shows the Total Sales in the Order Table.

Power BI Sum Measures

I hope you follow the above steps. This way, you can use the SUM function in Power BI.

Power BI SUM Multiple Measure

In Power BI, you can use the SUM function to add up the values of a particular measure in your dataset. However, if you want to sum up multiple measures (calculations) and display the total, you can create a new measure that combines the results of those individual measures.

Example:

Suppose the table has columns like Date, SalesAmount, and Expenses. Using this table, we want to calculate TotalProfit using SUM multiple measures.

Power BI sum Multiple columns

Let’s say you have two measures:

1. SalesAmount: Represents the total sales amount.

TotalSalesAmount = SUM(FinancialData[SalesAmount])

Where:

  • TotalSalesAmount = Name of the measure
  • FinancialData = Name of the Table
  • SalesAmount = Name of the Column
how to Add Multiple Columns Using DAX In Power BI

2. Expenses: Represents the total expenses.

TotalExpenses = SUM(FinancialData[Expenses])

Where:

  • TotalExpenses = Name of the measure
  • FinancialData = Name of the Table
  • SalesExpenses = Name of the Column
How to SUM Multiple Measure in Power BI

Now, we create a new measure called TotalProfit, the sum of the SalesAmount and the negative Expenses. To do this, create a new measure by using the below expression.

TotalProfit = [TotalSalesAmount] + (-[TotalExpenses])

Where:

  • TotalExpenses = Name of the measure
  • TotalSalesAmount = Name of the measure
  • TotalExpenses = Name of the measure
How to Add Two Measures in Power BI

Result:

Here, you see the result of the SUM multiple measures in the Power BI table visual.

Power BI SUM Multiple Measure

In this way, you can use Power BI SUM multiple measures.

Conclusion

SUM() function in Power BI is used to sum up a column of values in a table.

Now, you know about the Power BI SUM() measure. This tutorial taught us what the Power BI SUM() measures and how to use the SUM() in the Power BI measure. Additionally, we explained Power BI SUM multiple measures.

You may also like: