Forum Discussion
Calculating closing balance
- Anonymous1 year ago
Thanks for the reply from 123abc .
First of all, I want to confirm your request with you. Why is the value of B in October 170? Is it the value of A in December plus the value of B in October in the OB table?
The following test is for your reference.
Create a calculated column in each of the two tables, and then create a relationship between the two tables based on this column.
Create a measure as follows
Measure = VAR _sumN = CALCULATE(SUM([Value]), FILTER(ALL(NetCashFlow), 'NetCashFlow'[Month] <= MAX([Month]) && [Company] = MAX([Company]))) VAR _sumOB = CALCULATE(SUM(OpeningBalance[Value]), FILTER(ALL(OpeningBalance), [Month] <= MAX([Month]) && [Company] = MAX([Company]))) RETURN _sumN + _sumOBOutput:
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply from 123abc .
First of all, I want to confirm your request with you. Why is the value of B in October 170? Is it the value of A in December plus the value of B in October in the OB table?
The following test is for your reference.
Create a calculated column in each of the two tables, and then create a relationship between the two tables based on this column.
Create a measure as follows
Measure =
VAR _sumN = CALCULATE(SUM([Value]), FILTER(ALL(NetCashFlow), 'NetCashFlow'[Month] <= MAX([Month]) && [Company] = MAX([Company])))
VAR _sumOB = CALCULATE(SUM(OpeningBalance[Value]), FILTER(ALL(OpeningBalance), [Month] <= MAX([Month]) && [Company] = MAX([Company])))
RETURN
_sumN + _sumOB
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous Sorry for the confusion. That was by mistake. I tried this code. It works perfectly. Thanks for your solution !!