Im not sure if there was an update for this topic, but none of the above solutions worked for me as I imagine that I delegate the 'Sum' opertation to the data source with the filters applied in the gallery. The error message I get is the following:
Part of this formula cannot be evaluated remotely.'Sum' operation is not supported by this connector/service.
What I try to achieve is to sum gallery items based on the filters set in two dropdowns, something similar to SUBTOTAL in Excel.