Can't tell from here why you are getting an empty result--most likely guess is that it's a relationship issue, but even if the result weren't empty it wouldn't be the correct total for a filtered portal. Sum evaluates at the data level and thus ignores any portal filter. It would sum all related records--not just those shown in the filtered portal.
To show a total from a filtered portal, define a summary field in the portal's table that computes the total of the desired field. Then make a copy of your filtered portal (so that it has the same portal filter expression as the original), but change its setup to be a one row portal. Put your summary field from the portal's table in this one row portal to show the total of your original filtered portal.
What you say makes sense - the best I ever achieved was to get the sum of all related records, or sometimes just the first one.
Anyway, your solution does the job - many thanks, I wish I'd asked sooner.