Forum Discussion
Running total problem
Greg_Deckler
This is the data i have as test
This is the expected output i want:
The orange fields is what i use for the the calculation, and the green field is where i want the result
Hi
Please try this
Cashflow =
VAR minweek =
MIN ( RT[Week] )
VAR Firstcash =
CALCULATE ( MAX ( RT[Cash Balance] ), RT[Week] = minweek, ALL ( rt ) )
VAR Activweek = RT[Week]
VAR RTotal =
CALCULATE (
SUM ( RT[Net Cashflow] ),
RT[Week] > minweek
&& RT[Week] <= Activweek,
ALL ( RT )
)
VAR result =
IF ( Activweek = minweek, Firstcash, RTotal + Firstcash )
RETURN
result
- Robin962 years ago
Helper II
Hey,
Thanks for the response! This did not generate the desired outcome. i dont have every column in the same table as you have here.
i also get an error on the syntax at "Activweek" not sure why, guess it needs an expression.- JamesFR062 years ago
Resolver IV
Sorry I do not realize that you got informations in different tables
For Activweek, as you put it on a matrix use the selectedvalue(Date[Week])