Forum Discussion
cisrael
4 years agoNew Member
Calculate Balance
Hi all! I am wanting to calculate a balance that will include the previous period's net change (Screenshot below), except for period one. Is this possible to do? To add a little more inf...
V-lianl-msft
4 years agoCommunity Support
Hi cisrael ,
Please try to create a measure like below:
Measure =
var Balance_ = SUM('Table'[Debit])-SUM('Table'[Credit])
var Period_ = SELECTEDVALUE('Table'[Period ID])
var Debit_ = CALCULATE(SUM('Table'[Debit]),FILTER(ALLEXCEPT('Table','Table'[Account Number]),'Table'[Period ID] = Period_ -1))
var Credit_ = CALCULATE(SUM('Table'[Credit]),FILTER(ALLEXCEPT('Table','Table'[Account Number]),'Table'[Period ID] = Period_ -1))
return Balance_+Debit_-Credit_
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- cisrael64 years agoNew Member
Hi V-lianl-msft - thank you very much for your response! I have transferred the suggested measure but I am not getting the correct numbers. I'm sure it is something I am doing wrong, below is the output: