SUMX

The SUMX function returns the sum of the values taken by an expression that is evaluated for all the rows in a table.

Syntax

SUMX(
    table,
    expression
)

Parameters
  • table: Table containing the rows for which the expression will be evaluated.
  • expression: Expression to evaluate for each row of the table.
Returned value

The SUMX function returns a real number.

Additional Information

The function evaluates the expression included as the second argument for each of the rows of the indicated table, adding all the results and returning this value. Only numerical values are considered, ignoring Blanks, Boolean values and texts.

The table argument can be either a table or a function that returns a table.

Examples

Suppose we have the following table showing the sales list, including the number of items sold and their unit price:

SUMX function. Example of use

We can define the following measure:

Ventas totales = SUMX(Ventas, Ventas[Cantidad] * Ventas[Precio])

...which performs the Quantity * Unit Price calculation for each of the rows and adds these partial values. If we take the measurement to a card-type display, we obtain the desired result:

SUMX function. Example of use

Related functions
Category
Mathematical and trigonometric
Submitted by admin on Tue, 12/04/2018 - 00:15