In this article, we give the answer to the following question: Given a field F, finite subsets A 1 , . . . , Am of F, and r linearly independent polynomials f 1 , . . . , fr ∈ F[x 1 , . . . , xm] of total degree at most d. What is the maximal number of common zeros f 1 , . . . , fr can have in A 1 ×· · ·×Am? For F = Fq, the finite field with q elements, answering this question is equivalent to determining the generalized Hamming weights of the so-called affine Cartesian codes. Seen in this light, our work is a generalization of the work of Heijnen-Pellikaan for Reed-Muller codes to the significantly larger class of affine Cartesian codes.