How can I calculate the sum in Power BI, and can you provide an example?

Power BI is a business intelligence tool that allows users to analyze and visualize data. One of its functionalities is the ability to calculate sums of numerical values within a dataset. This can be achieved by using the “Sum” function, which adds up all the values in a selected column or measure. For example, to calculate the sum of sales for a particular product, the user can use the “Sum” function on the sales column and Power BI will provide the total sum. This feature is useful for performing various calculations and gaining insights from the data.

Calculate Sum in Power BI (With Example)


You can use the following syntax in DAX to calculate the sum of values in a column:

Sum Points = SUM('my_data'[Points])

This particular example creates a new measure named Sum Points that calculates the sum of values in the Points column of the table named my_data.

The following example shows how to calculate the sum of values in a column in Power BI in practice.

Example: How to Calculate Sum in Power BI

Suppose we have the following table in Power BI named my_data that contains information about points scored by basketball players on various teams:

Suppose we would like to calculate the sum of values in the Points column.

To do so, click the Table tools tab along the top ribbon, then click the New measure icon:

Then type in the following formula into the formula bar:

Sum Points = SUM('my_data'[Points]) 

This will create a new measure named Sum Points that contains the sum of values in the Points column of the table:

Power BI calculate sum

If we’d like, we can display this value by going to the Report View in Power BI, then by clicking the Card icon under the Visualizations tab, then by dragging the Sum Points measure under the Fields label:

This will produce the following card that displays the sum of values in the Points column of the table:

We can see that the sum of all values in the Points column is 219.

Additional Resources

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

x