Both barium and magnesium are alkaline earth metals of like ionic bonding capabilities; 2 +. Nitrate is a polyatomic ion of - 1 change and sulfate is a poly atomic ion of - 2 charge.
Ba(NO3)2 + MgSO4 --> BaSO4 + Mg(NO3)2
======
So, this simple double displacement reaction is balanced as is.