How can I get other content type data in current content type?
What you need to do is make X a taxonomy term.

1) Go to taxonomy and create a vocabulary (ex: Colors)

2) Inside Colors vocabulary, add terms. (ex: Red, Blue, Green, Yellow etc..)

3) Go to contentype1 manage fields and add a new field of type: Taxonomy Term Reference. Then select the vocabulary (colors).

4) Now edit your contentype1 nodes and give them a taxonomy term. Ex: Node 1 blue, Node 2 red, Node 3 blue, ...etc

5) Repeat steps 3) and 4) but with contentype2 this time.

6) Create a block view of contenttype2 (You will see it lists all the contentype2 nodes)

7) Under Advanced, add Relationship of Terms of the node, checkmark Colors and checkmark require relationship. 

8) Add a contextual filter of Taxonomy Term and for when filter is not available, set it up like this (using screenshot from another answer):



Once you add the contextual filter, your view preview will go blank, which is normal. Go to a contentype1 node, where you placed the view block, and you should see contenttype2 nodes that have the same taxonomy term as the current contentype1 node that you're viewing.