Forum Discussion
Akolade
3 years agoRegular Visitor
DAX with For and while loop
I have this table Account Ref Amount Date Org code 1 25 24 February 2000 A 2 25 24 February 2000 A 3 25 14 March 2000 B 4 25 20 March 2000 B 5 34 4 April 2000 B...
- Anonymous3 years ago
Hi Akolade ,
You can create a calcualted column. And you need to create a relationship first.
Column = var _initial=RELATED('pot Fund'[InitialFund]) var _culmative=CALCULATE(SUM('Table'[Amount]),FILTER('Table',[Date]<=EARLIER('Table'[Date])&&[Org code]=EARLIER('Table'[Org code])&&[Account Ref]<=EARLIER('Table'[Account Ref]))) return _initial-_culmativeHere's the result.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Hi Akolade ,
You can create a calcualted column. And you need to create a relationship first.
Column = var _initial=RELATED('pot Fund'[InitialFund])
var _culmative=CALCULATE(SUM('Table'[Amount]),FILTER('Table',[Date]<=EARLIER('Table'[Date])&&[Org code]=EARLIER('Table'[Org code])&&[Account Ref]<=EARLIER('Table'[Account Ref])))
return _initial-_culmative
Here's the result.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.