Calculation fields such as your Sum function evaluate at the data level. The portal filter evaluates at the layout, or "presentation" level so filters do not affect how calculation fields evaluate.
Define a summary field in the portal's table to compute the sum of the same field you summed with the sum function.
Put a one row portal to the same portal table on your layout. Give it the same filter expression and put this summary field inside the portal. Unlike your calculation field, this summary field will show the correct total for your filtered records.