Add a calculated field 'NumberOfPendingInvoices’ to entity Project. Assign a microflow to 'NumberOfPendingInvoices’ that does the calculation by a retrieve-activity for entity Invoice with xpath-constraint [Status = 'Due’] followed by a AggregateList-activity Count returning the Count to the calculated field.
Add 'NumberOfPendingInvoices’ to your Project-Datagrid.
The calculation microflow: https://modelshare.mendix.com/models/16f503fc-d982-4bcb-9bee-0fd660a022f1/call-project-number-of-invoices-due
The datagrid for the project-entity
And see https://mydemoversion8-sandbox.mxapps.io/ → Forumquestions → Question 94949 for the live version