This expression in chart with Group as a dimension
is just an inefficient way of saying
The first expression is the correct way of expressing the sum and is the equivalent of the chart. If the totals are different, then you are using an expression total rather than a sum of rows, and the equivalent would then be the second expression. Unless you have some restrictions in the chart such as a calculated dimension that filters GROUP.
If that does not resolve the problem, then I suggest you post your qvw or a representative sample to see why it is behaving this way.
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein