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.
P.S.: Answered in the QlikView Desktop community as well.