Forum Discussion
akhilduvvuru
Helper IV
1 year agoOpening and Closing balance recursive calculation
Team, I have a requirement where I have table with 3 fields 1. Value Date, 2. Actual Amount, 3. Flow Amount as mentioned below coming from backend Date Actual Amount Flow Amount 18/12/24...
- 1 year ago
Try it like this.
Fcst Amt = VAR _LastActual = CALCULATE ( LASTNONBLANK ( 'Table'[Date], CALCULATE ( SUM ( 'Table'[Actual] ) ) ), ALL ( 'Table' ) ) VAR _LastActualAmt = CALCULATE ( LASTNONBLANKVALUE ( 'Table'[Date], CALCULATE ( SUM ( 'Table'[Actual] ) ) ), ALL ( 'Table' ) ) VAR _RowDate = 'Table'[Date] RETURN IF ( _RowDate <= _LastActual, 'Table'[Actual], _LastActualAmt + CALCULATE ( SUM ( 'Table'[Flow] ), ALL ( 'Table' ), 'Table'[Date] > _LastActual, 'Table'[Date] <= _RowDate ) )
akhilduvvuru
Helper IV
1 year agodanextian Ritaf1983 rajendraongole1 Greg_Deckler Ashish_Mathur lbendlin amitchandak jdbuchanan71 Anonymous Anonymous v-henryk-mstf - Any help here is much appriciated. Thanks!