Well, to get the balance field, for example, in a previous row, the XPath would look something like this:
../preceding-sibling::my:group2[my:Account = current()/../my:Account]/my:Balance
With group2 replaced with your repeating group, and the other fields also set to the correct names for your data source.
I'm thinking you may want to do this as a rule on your Item Cost and Account fields - run if any preceding-siblings have the same account number, for example.