First, the query in the totalCapacityDs datasource doesn’t correspond the specified class Scheme and view
<![CDATA[select SUM(e.capacity) from waterschemenigeria$Scheme e]]>
Second, CUBA doesn’t support aggregate functions from the client side, because it cannot resolve security permissions for such fields. I would propose creating a service that provides you with the desired data, call this service from the controller (e.g. in init method of your screen) and fill out a text field.
P.S. We will consider ways to simplify the proposed approach and enable using aggregate functions from the client side. Thank you for pointing the place that can be improved!