I shouldn't have assumed it was relational. Could you try setting a Solve Order on the metrics in the query? Ensure the 'Total' metric has the highest solve order.
Ex: Set 'Solve Order' on the measure to 100, and set the Total solve order to 1000. This...
Ex: Set 'Solve Order' on the measure to 100, and set the Total solve order to 1000. This...