Forum Discussion
Bring previous balance
Hi guys
I have many rows, with the account, account description, debits, credits, and the initial balance and the final balance, so my query for the initial balance is:
My problem is when I filter for dates, if the last movement of the the account "xx-xx-xx" was on april 2019, and in 2020 I don't have any movements, it will never be shown with this filter. How could I indicate that I want to continue showing the accounts with the final balance <>0, in order to have the real balance in each filtered period?
- Anonymous5 years ago
@yingyinr Hi, I fixed it with:
Saldo inicial1 =VAR __Account = MAX([CTA_CONTABLE])VAR __MinDate = MINX(FILTER('3Saldo ini','3Saldo ini'[CTA_CONTABLE] = __Account),[PERIODO])RETURNCALCULATE(SUM('3Saldo ini'[SALDO_INICIAL]),filter( '3Saldo ini','3Saldo ini'[CTA_CONTABLE] = __Account && [PERIODO] = __MinDate ))I was selecting wrong the columnsThank you so muchKind regards
Eduardo Silva
6 Replies
- amitchandak
Super User
Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- AnonymousNot applicable
amitchandak hey, sure:
for example, this account is an asset, when I filter by date, selecting 2019, everything is ok, because my date for this row is 2019, but when I filter any month or the complete year 2020, the problem is that the system doesnt found that account in those dates and my sum of assets doesnt take that account.
- PaulDBrown
Community Champion
Anonymous
You might want to explore the functions available, such as OPENINGBALANCEMONTH
- AnonymousNot applicable
@PaulDBrown thank you Paul, but how could I applied it if I could filtered by different periods of time
(account - open balance - debits - credits - final balance)
- AnonymousNot applicable
Hi Anonymous ,
I'm sorry that I still have some confusion about your requirement. Could you please provide more sample data and explain your problem&desired result with specific data examples? And could you please list the fields/measures which applied in Matrix and slicer? Are they from the same table?
My problem is when I filter for dates, if the last movement of the the account "xx-xx-xx" was on april 2019, and in 2020 I don't have any movements, it will never be shown with this filter. How could I indicate that I want to continue showing the accounts with the final balance <>0, in order to have the real balance in each filtered period?
Best Regards
Rena