Congratulations on being an new IntoPath'r/SharePoint Guru.
I couldn't see from your screenshot, are the fields you want to sum in a repeating table/section? You would want to put them in a repeating table/section! When you do have them in a repeating table/section then the solution becomes relatively easy. I have added a form for you to look at that replicates the following screenshot.

What you need to do is add a filter to your SUM condition (which creates the IF.. before the SUM) so in my example:
sum(../my:group1/my:group2/my:field2[../my:field3 = string(true())]) the bold is the IF statement.
When you are setting up your summation you have to select the 'Filter Data' button in InfoPath to do this:
You will get lots of dialog boxes and your screen will look similar to this:

Have a look at the form I attached, you'll work it out, you've done a really good job so far.
Good luck