Joint contingency table

Hi
Let’s say we have two variables x,y. Each can take a fixed set of values. Is there any differentiable method, which can be used to build a contingency table for both these variables?.