It's not obvious. You cannot access the total of just the filtered records in a calculation.
You can use a one row portal with the same filter to show a summary field defined in the portal's table to show the total. And this total is "display only" if you then need to use that value in a calculation, you will not be able to do so. You'd need to use a relationship to the portal's table that does not require a portal filter due to building the filter logic into the match fields used in the relationship. (Or use ExecuteSQL to get this same total.)