The set expression is evaluated once for the table, not once per row, so for A, the expression reports A in August, which is zero as there is no data for A in August.
The best solution is to add a last sales flag during reload. Something like
Max(Month) As Month,
1 As LastSale
Group By Customer;
Now your expression becomes: