Cross elasticity of demand measures the change in demand of good due to the change in price of another good. It is due to 2 reasons: -
In case of substitute goods, a rise in price of substitute goods would raise the demand of the good and a fall in price of substitute goods would reduce the demand of the good.
Accordingly in case of complementary, a rise in price of complementary goods would reduce the demand for the good and vice-versa.
Example: - An increase in price of sugar would increase the demand for jaggery which may act as a substitute for sugar. But an increase in price of table tennis racket may reduce the demand of table tennis balls as they are complementary.
Cross elasticity of demand =% change in the quantity demand of product X