Forum Discussion
Anonymous
7 years agoNot applicable
Recursive column in DAX
Hey, How can I achieve the following in a column in a DAX, this sounds a bit like recursive. I have a table like following in PowerBI, in which I wish to populate Column B in the following step...
- 7 years ago
Hi Anonymous ,
To create two calculated column as below.
Column = VAR k = FILTER ( 'Table', 'Table'[Column A] <> BLANK () ) VAR minr = CALCULATE ( MIN ( 'Table'[Row] ), ALL ( 'Table' ), KEEPFILTERS ( k ) ) RETURN IF ( 'Table'[Row] = minr, 'Table'[Column A], 0 - 'Table'[Column A] )new column B = CALCULATE ( SUM ( 'Table'[Column] ), FILTER ( 'Table', 'Table'[Row] <= EARLIER ( 'Table'[Row] ) ) )
v-frfei-msft
7 years agoCommunity Support
Hi Anonymous ,
To create two calculated column as below.
Column =
VAR k =
FILTER ( 'Table', 'Table'[Column A] <> BLANK () )
VAR minr =
CALCULATE ( MIN ( 'Table'[Row] ), ALL ( 'Table' ), KEEPFILTERS ( k ) )
RETURN
IF ( 'Table'[Row] = minr, 'Table'[Column A], 0 - 'Table'[Column A] )
new column B =
CALCULATE (
SUM ( 'Table'[Column] ),
FILTER ( 'Table', 'Table'[Row] <= EARLIER ( 'Table'[Row] ) )
)