Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Calculated column
Calculated table
Measure
Visual calculation
Returns a running sum calculated along the given axis of the visual matrix. That is, the sum of the given column calculated over all elements up to the current element of an axis.
Syntax
RUNNINGSUM ( <column>[, <axis>][, <blanks>][, <reset>] )
Parameters
Term | Definition |
---|---|
column |
The column that provides the value for each element. |
axis |
(Optional) An axis reference, the direction along which the running sum will be calculated. |
blanks |
(Optional) An enumeration that defines how to handle blank values when sorting the axis . The supported values are:
|
reset |
(Optional) Indicates if the calculation resets, and at which level of the visual shape's column hierarchy. Accepted values are: a field reference to a column in the current visual shape, NONE (default), LOWESTPARENT , HIGHESTPARENT , or an integer. The behavior depends on the integer sign: - If zero or omitted, the calculation does not reset. Equivalent to NONE . - If positive, the integer identifies the column starting from the highest, independent of grain. HIGHESTPARENT is equivalent to 1. - If negative, the integer identifies the column starting from the lowest, relative to the current grain. LOWESTPARENT is equivalent to -1. |
Return value
A scalar value, the running sum up to the current element of the axis.
Remarks
This function can be used in visual calculations only.
The axis
, blanks
and reset
parameters can be omitted.
If the value of reset
is absolute (i.e., a positive integer, HIGHESTPARENT
or a field reference) and the calculation is evaluated at or above the target level in the hierarchy, the calculation resets for each individual element. That is, the function is evaluated within a partition containing only that specific element.
Example
Given a table that summarizes the total sales for each product category and calendar year, the following DAX query adds a column with the total sales for that category up to a given year.
SalesUpToDate = RUNNINGSUM([SalesAmount], Rows)
The screenshot below shows the visual matrix and the visual calculation expression: