Forum Discussion
Running total problem
Robin96 Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
- Robin962 years agoHelper II
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- JamesFR062 years agoResolver IV
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 agoHelper 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.