By coincidence I stumbled upon your several years old post.
I might have a solution for you. Try:
sum(aggr(floor((sign(sum(Balance))+1)/2), Payer, Month))
This is a way around time consuming if statements, and should be much faster. Sign() returns 1 for positive balance, 0 for 0 balance and -1 for negative balances. by adding one and dividing by two, negative lances become 0, zero balances become 0.5 and our desired positive balances become 1. Floor() cuts the decimal, so the zero balances also return 0.
We are left with 1 for each positive balance; The same result without the IF statement.