Use the portal "filter" option to hide the rows that you don't want shown.
There must be an issue with the calculation. Any "portal row" that evaluates the filter calculation to true or 1 will show. Any portal row that evaluates filter calculation to 0 or false will not show.
You could test the result of your calculation by creating your calculation as a field and display that field in the portal.
The same calculation worked and hided the rows when I used on "hide object". But it left all them blank spaces.
I was thinking it should work in portal filtering options.
Just note that you can't use the exact same calculation, filter works the opposite to hide. Filter will show rows that evaluate to true, hide will hide objects that evaluate to true.
While Carl has given you the correct answer to the question you were asking, you might want to back up and reconsider your data model. The fact that you have duplicate records with identical information on them suggests your data model is not properly normalized.
An "order" is a single item for a single customer; there shouldn't be more than one just because there are different products on it. The products should go in a separate child table, related to the parent order, so that you don't have to filter the orders at all.
Be aware that, as your data load climbs, your portal filter will perform slower and slower and will pose a problem.