Forum Discussion
DAX with For and while loop
- Anonymous2 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.
amitchandak for your time. What I really need is DAX that will Perform a sort of row context and iteration for the upper table with a condition
for example: If the Org code = "A" then the amount on that row which is 25 will be duducted from the £2000 in the pot fund table leaving the balance to £1975.
The next row which is Account 2 with the same organisation(A) the Amount (25) will be deduccted from the balance (£1975). The same goes with org code "B"
The idea is to know the balance of the pot fund at any point in time.
Thank you