I would suggest, creating a view in the database. And then use the Designer to map this view to a typed view, or to an Entity if you want to relate it to other entities.
Using Customers-Orders tables in Northind as an example
the database view may look like this:
select Customers.ContactName, RelatedTable.OrdersCount
from Customers Inner join
(
select CustomerID, Count(OrderID) as OrdersCount
from Orders
Group By CustomerID
) RelatedTable
On RelatedTable.CustomerID = Customers.CustomerID