It's hard to tell what's wrong with the information given. Context matters, so more information about the expression context, the data model and data would be helpful. If possible, upload a small sample QVW.
To start debugging your expression, try to put each aggregation function (Sum() ) in an expression on its own and check the returned values (also when changing the selection).
I assume you are not expecting the set analysis to somehow consider your current dimension lines, right? Set analysis is evaluated only once per chart, not per dimension line.