DAX SUM function
Adds up all the numbers in a column.
SUM is the first function most people write in Power BI. It adds every number in one column, under whatever filters the visual applies: in a table by Country, each row adds only that country's rows.
Syntax
SUM(<column>)| Argument | Required | Description |
|---|---|---|
| column | Required | The column that contains the numbers to add. It must be a column, not an expression. |
Returns: A decimal number. Blank if there are no rows.
Examples
Calculated on the free practice data (table financials), with [Total Sales] = SUM(financials[Sales]) and [Total Profit] = SUM(financials[Profit]).
1. Total sales
Total Sales = SUM(financials[Sales])Result: 118,726,350.26
All 700 sales rows added up.
2. Total sales by country
Total Sales = SUM(financials[Sales])| Country | Total Sales |
|---|---|
| Canada | 24,887,654.88 |
| France | 24,354,172.29 |
| Germany | 23,505,340.82 |
| Mexico | 20,949,352.11 |
| United States of America | 25,029,830.16 |
| Total | 118,726,350.26 |
The same measure in a table by Country: each row is filtered to one country, and the total row has no country filter.
Good to know
- SUM takes a column only. To add a calculation per row, like Units × Price, use SUMX.
- Blank values are ignored. Text in a number column causes an error.
- Write it as a measure, not a calculated column, so it responds to filters.
Related functions
Official reference: SUM function on Microsoft Learn