Hello @pedroccamara,
Yup, you’re almost onto the right track. As you said that -
If it’s Ativo then Debits, else credits. What do you guys think? Not the best approach -
What you can actually do is rather than going for the category approach directly go for the sub-categories approach. That is firstly calculate the sub-totals for each sub-category - Current Assets, Current Liabilities and so on.
Then once the sub-totals are calculated for each of the sub-categories. Just go for the Totals for each of the category by adding up the totals of each sub-categories. That is -
Assets = Current Assets + Fixed Assets + Other Assets
This same approach goes for Current Liabilities as well.
Now, once you have built all these small chunk of measures. Go for the master measure at the end. That will incorporate all these measures.
But before you proceed further, as you said -
There’s 4 or 5 account numbers, that can have both credit and debit values.
I didn’t understand this statement. Is is the naming convention or something else? Because if it’s a same naming convention i.e. same type of account name appearing on the Assets as well as the Liabilities side. It will be very much important to correct that. I’m providing a link of the solution where how the same type of convention affected the Balance Sheet totals. Although the query started with the formula error but ended with the naming convention problem as well.
If you need anything just give a shout and will always be happy to help.
Have a great weekend.
Hoping this link helps you, if that’s the case.
Thanks and Warm Regards,
Harsh