In OData (v4) you have the $inlineCount and $count query options that can be used to retrieve the amount of records.
https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#count
See http://localhost:8080/odata-doc/
http://localhost:8080/sample/odata/v1/Customers/$count
If you to filter on only projects with Parent project (replace ParentCustomer with ParentProject)
http://localhost:8080/sample/odata/v1/Customers?$expand=ParentCustomer&$filter=ParentCustomer ne null&$count=true&$top=0
If you use External Entities you can do it the same way as for persistent entities: a retrieve and count in a microflow will only call the count on the rest api. See the trace message in the screenshot.