We present combined experimental and theoretical studies on the magnetic properties of a solid solution between yttrium orthoferrite and yttrium orthochromite systems, YFe$_{1-x}$Cr$_x$O$_3$ (0 $leq$ x $leq$ 1) where Fe$^{3+}$ and Cr$^{3+}$ ions are distributed randomly at the same crystallographic site (4b). We found that all the compositions exhibit weak ferromagnetism below the Neel temperature that decreases non-linearly with increasing $x$, while certain intermediate compositions ($x = 0.4,0.5$) show a compensation point and magnetization reversal. This unusual behavior is explained based on a simple model comprising the isotropic superexchange and the antisymmetric Dzyaloshinskii-Moriya interactions. This model explains the magnetization behavior in the entire range of doping and temperature including the magnetization reversal which results from an interplay of various DM interactions such as, Fe-O-Fe, Cr-O-Cr and Fe-O-Cr.