PREVIOUS
Applies to: Calculated column Calculated table Measure Visual calculation
Used in visual calculations only. Retrieves a value in the previous element of an axis in the visual matrix.
Syntax
PREVIOUS ( <column>[, <steps>][, <axis>][, <blanks>][, reset] )
Parameters
Term | Definition |
---|---|
column |
The column to be retrieved. |
steps |
(Optional) Indicates the number of rows to go backward to fetch the value. If omitted, 1 is used (the exactly previous row). |
axis |
(Optional) An axis reference. If omitted, the first axis of the Visual Shape definition is used. |
blanks |
(Optional) An enumeration that defines how to handle blank values when sorting. The supported values are:
|
reset |
(Optional) Specifies how the calculation restarts. Valid values are: None , LowestParent , HighestParent , or an integer. None is the default value. |
Return value
The value of column
from the previous element of the axis.
Remarks
This function can only be used in a visual calculation.
Example
The following visual calculation returns the sales amount of the previous row on ROWS axis, that resets on the lowest parent.
PreviousInternetSalesAmount = PREVIOUS ( [Sum of SalesAmount], ROWS, LowestParent )
The screenshot below shows the visual matrix and the visual calculation expression: