That If() may be returning more than one result of StockLevel per dimension value, and you need to aggregate them, so the following as the expression in the first chart instead of the actual should work
Sum(If(Date(Aggr(NODISTINCT Max(StoreDate), EAN, Customer)) = StoreDate, StockLevel))
Hope that helps.
EDIT: P.S.: This is not a newbie question, so as far as I'm concerned, this should be the right place to be.