Yes, your calculations are correct.
You can use the of the solution to determine how many moles of dipotassium phosphate you’d get in 500 mL, then multiply that value by the molar mass of the compound
##C = n/V => n = C * V##
##n_(K_2HPO_4) = 0.4″moles”/cancel(“L”) * 500 * 10^(-3)cancel(“L”) = “0.2 moles “## ##K_2HPO_4##
and
##0.2cancel(“moles “K_2HPO_4) * “174.17 g”/(1cancel(“mole “K_2HPO_4)) = “34.83 g “## ##K_2HPO_4##
If you take into account , the answer should be
##m_(K_2SO_4) = “30 g”## ##->## since you only give one sig fig for the volume and of the dipotassium phosphate.