Modify your Goal calculation to use the ATTR function as follows:
IF ATTR([Exclude])="No" THEN 12
ELSEIF ATTR([Exclude])="Yes" Then NULL
Then re-drag Goal onto your Marks Detail, it will now appear as AGG(Goal).
ATTR checks if all the values of Exclude are the same, which will be true if set to No or Yes but not if set to All.
Thank you Zach! Worked perfectly. Appreciate the ATTR explanation - this will be a useful function in the future.