---
title: SUM
description: Learn how to use the SUM function to calculate totals in numeric datasets. Explore examples, syntax, and scenarios for efficient data analysis and total calculation in your dashboards.
---
import { Aside, Steps } from '@astrojs/starlight/components';

# SUM

The SUM function in Infoveave calculates the sum of values within a specified dataset or column.

## Applicable to

* Calculated Columns
* Expressions

## Return Value

The sum of all values in the specified dataset or column.

## Remark

* Used only for numeric values.
* Useful for deriving totals.
* Cannot be used across date and strings.
* Neglects nulls and blank values.

## Syntax

```
SUM(<expression>)
```

## SUM in Board Expression

<Aside>
Expressions add visual effects to your dashboard through widget-specific conditions. They do not manage or modify data.
</Aside>

| Parameter     | Description                                                                                    |
|---------------|------------------------------------------------------------------------------------------------|
| Expression    | A placeholder in a function replaced with the actual widget and measure names.                 |
| Widget Name   | The specific name or identifier of the widget used for data visualization in the Infoboard.    |
| Measure       | The name of the measure displayed or analyzed using the widget.                                |

Steps to Use SUM

<Steps>
1. Write the SUM function. For instance `SUM(<expression>)`
2. Replace `<expression>` with `'Widget Name'[Measure]`. Replace **Widget Name** with your widget's name and **Measure** with the measure name.
3. To learn how to configure an Expression in Infoveave, visit the [Configure Expression](/insights-v8/advanced-configuration/#configuring-expressions) section.
</Steps>

<div role="alert">

**Scenario** Managing an Energy Consumption Dashboard, calculating the ratio of solar customers to total customers, triggering an action if the ratio is less than 0.5.

**Scenario Details**

* **Dashboard Name** Solar Energy Management Dashboard
* **Widget Name** Solar Feed In, Total Customer
* **Measure Name** Solar Customers, Total Customers

**Objective** Track the ratio of solar customers to total customers and take action if it exceeds or falls below a threshold (here, less than 0.5).

You can use the SUM function like this

```
(SUM('Solar Feed In'[Solar Customers])) / (SUM('Total Customers[Total Customers])) < 0.5
```
</div>

## SUM in Calculated Columns

| Parameter     | Description                                                                        |
|---------------|------------------------------------------------------------------------------------|
| Expression    | A placeholder in a function replaced with the column names.                        |
| Column Name   | The name of the column containing the values you want to analyze.                  |

Steps to Use SUM in Calculated Columns

<Steps>
1. Write the SUM function. For instance `SUM(<expression>)`
2. Replace `<expression>` with `[Column Name]`. Replace **Column Name** with the actual column name.
3. To learn how to add calculated columns in Infoveave, visit the [Calculated Columns](/studio-v8/datasources/calculated-columns-datasource/) section.
</Steps>

<div role="alert">

**Objective** Find the total number of items sold under the category CEREAL.

| ORDER DATE | COUNTRY | CATEGORY | UNIT PRICE | MARKET PRICE | QUANTITY |
|------------|---------|----------|------------|--------------|----------|
| 2024-01-03 | Brazil  | Baby Food | 38.41      | 43.7874      | 2        |
| 2024-01-07 | Japan   | Spices   | 45.56      | 50.8155      | 20       |
|            | Japan   |          |            | 43.7874      | 10       |
| 2024-01-18 |         |          |            | 32.3019      | 4        |
| 2024-01-22 | Brazil  | Cosmetics| 28.335     | 23.0109      | 7        |
| 2024-01-26 | Canada  |          | 20.185     | 23.0109      | 9        |
| 2024-01-04 | France  | Cereal   | 25.26      | 28.7964      | 9        |
| 2024-01-09 | Brazil  | Cereal   | 44.575     | 50.8155      | 8        |
| 2024-01-14 | Brazil  | Snacks   | 20.185     |              | 4        |
|            | Brazil  | Cosmetics| 40.485     | 46.1529      | 2        |

You can use the SUM function like this

```
SUM([QUANTITY])
```

The new calculated column "Total Cereal Sold" will return 17. Note that the example in the original HTML incorrectly states 75. A corrected table follows

| ORDER DATE | COUNTRY | CATEGORY | UNIT PRICE | MARKET PRICE | QUANTITY | TOTAL QUANTITY |
|------------|---------|----------|------------|--------------|----------|----------------|
| 03-01-2024 | Brazil  | Baby Food | 38.41      | 43.7874      | 2        | 17             |
| 07-01-2024 | Japan   | Spices   | 45.56      | 50.8155      | 20       | 17             |
|            | Japan   |          |            | 43.7874      | 10       | 17             |
| 18-01-2024 |         |          |            | 32.3019      | 4        | 17             |
| 22-01-2024 | Brazil  | Cosmetics| 28.335     | 23.0109      | 7        | 17             |
| 26-01-2024 | Canada  |          | 20.185     | 23.0109      | 9        | 17             |
| 04-01-2024 | France  | Cereal   | 25.26      | 28.7964      | 9        | 17             |
| 09-01-2024 | Brazil  | Cereal   | 44.575     | 50.8155      | 8        | 17             |
| 14-01-2024 | Brazil  | Snacks   | 20.185     |              | 4        | 17             |
|            | Brazil  | Cosmetics| 40.485     | 46.1529      | 2        | 17             |
</div>

