Forum Discussion
Birinder
3 years agoHelper III
How to add previous row value in current row value while having 2 categorical variables ?
Hi Community, I have a dataset table named as "IBNS". Under it, I have 3 columns as follow:- 1. KEY (Data type - text) 2. Date (Data type - Short Date) 3. RRT - (Data type - Decimals) I want...
- 3 years ago
- 3 years ago
Hi Birinder,
Sure, please try this CC:
And the same in plain text:
PrevSum v2 = VAR CurrentKey = [KEY] VAR CurrentDate = [Date] VAR PrevYear = CALCULATE ( YEAR ( MAX ( data[Date] ) ), ALL ( data ), data[KEY] = CurrentKey, data[Date] < CurrentDate ) VAR PrevRRT = MINX ( FILTER ( ALL ( data ), AND ( [KEY] = CurrentKey, YEAR ( [Date] ) = PrevYear ) ), [RRT] ) RETURN IF ( ISBLANK ( PrevRRT ), 0, [RRT] + PrevRRT )Best Regards,
Alexander
Ahmedx
3 years agoSuper User