Skip to main content
< All Topics

DAX Library: SUM Function

The SUM function is the foundation of almost every Power BI report. It is a simple “aggregator” that adds all the numbers in a single column to return a single total.


1. Description: What does it do?

The SUM function scans a specific column in your table and adds up every numeric value.

  • Automatic Filtering: It automatically respects any “Filter Context” applied to your report (e.g., if you have a slicer for “2026,” it only sums the rows for that year).
  • Handling Blanks: If a row contains a NULL or a BLANK, the function simply ignores it rather than throwing an error.

2. Official Syntax & Code Examples

The Syntax:

SUM(<ColumnName>)

Example 1: Basic Total Sales

This is the most common use case. It creates a “Measure” that you can drop into any chart or card.

Code snippet

Total Sales = SUM(Sales[SalesAmount])

Example 2: Official Usage in Context

In a professional report, you often use SUM inside other functions like CALCULATE to find specific subsets of data.

Code snippet

UK Sales Only = 
CALCULATE(
    SUM(Sales[SalesAmount]), 
    Sales[Region] = "United Kingdom"
)

3. Common Mistakes & How to Fix Them

MistakeWhy it happensThe Fix
The “String” ErrorYou are trying to sum a column that Power BI thinks is “Text” (e.g., a “Price” column that has a £ symbol in the raw data).Go to Transform Data (Power Query) and change the Data Type of that column to Decimal Number.
Incorrect Totals in TablesYou are summing a column that contains “Pre-calculated” percentages or averages.Never SUM an average. Instead, create a measure that performs the math at the total level (e.g., Total Profit / Total Revenue).
Using it for Row MathYou tried to write SUM(Sales[Price] * Sales[Qty]). SUM only accepts one column name.Use SUMX (see below) or create a “Calculated Column” for the multiplication first.

4. SUM vs. SUMX: What is the difference?

This is the most common question for beginners. While SUM adds up a single column, SUMX is an iterator—it goes row-by-row to perform math (like Price × Quantity) before adding everything up.

Read the Full Comparison Article: >SUM vs. SUMX: When to use Iterators in Power BI

5. Further Examples of How to use Sum

✓ Expert Verified This documentation has been written and reviewed by our Power BI Experts to ensure technical accuracy and compatibility with the January 2026 Power BI Desktop update.

1. Inventory & Operations: Total Units Received

This is used by warehouse managers to track the volume of physical stock entering the building.

Code snippet

Total Stock In = SUM(Warehouse[UnitsReceived])
  • Business Value: Helps identify if the warehouse is hitting its “Intake” targets for the week.

2. Human Resources: Total Training Hours

Companies use this to track professional development across different departments.

Code snippet

Total Study Hours = SUM(EmployeeTraining[DurationHours])
  • Business Value: Proves compliance for industry certifications or calculates the “Cost of Learning” per employee.

3. E-commerce: Total Shipping Weight

Used to estimate logistics costs or determine if a fleet of delivery vehicles is over-capacity.

Code snippet

Total Payload KG = SUM(Orders[ParcelWeight_KG])
  • Business Value: Critical for calculating fuel efficiency or negotiating better rates with shipping carriers like DPD or FedEx.

4. Customer Support: Total Resolution Time

Used to measure the total “man-hours” spent on solving customer issues.

Code snippet

Total Support Minutes = SUM(Tickets[MinutesToResolve])
  • Business Value: By comparing this to the “Number of Tickets,” you can find your Average Handling Time (AHT).
Table of Contents
Scroll to Top