Thanks, Niyas. But it does not really do what I would expect. In your filter "customers" is also active, which means that only customers without a parent company are visible (so no contacts linked to the customer company). When the sales orders are directed to a contact rather than its company, the filter "sales_order_ids != 0 does not work anymore because sales order count is apparently not transferred from contact to parent company.
Because all our sales orders are addressed to contacts, your proposed filter gives zero results with me. When I remove the filter "customers" however, it works and list all the contacts (but not the parent companies to which the contacts belong). When I group by company then, it gives the results I was looking for.
Strange though that sales order count is not transferred to the actual customer (company), but is only linked to the contact.