Are you trying to dynamically limit the number of portal rows shown on your layout? That's not really possible though you may be able to simulate that effect with some scripting that either changes layouts or selects from multiple panels of a tab or slide control--each with a differently sized portal in it.
You can count the number of rows in an unfiltered portal by counting the number of related records. Sum from the parent record or a summary in the portal table can return that count.
I took your suggestion and it works.
Thank you much!