The problem is that your if statement doesn't aggregate. So for any OrderNo with more than one record it can't determine which sum(Amount) it should use. Sum(200) or sum(120).
What you probably want is the other way around: sum(if(PartGroup='PartB' and left(PartNo,1)=3,Amount)).
You can rewrite that to a set analysis expression: