In order to find the total mass of Na3PO4, we need to add all the value of mass from each individual element, and in this compound we have:
Na = 23g, but we have 3, 23*3 = 69 grams of sodium
P = 31 grams of phosphorus
O = 16g, but we have 4, 16*4 = 64 grams of oxygen
69 + 31 + 64 = 164 g/mol is the molar mass of this compound
The percent composition for each element is:
69/164 = 42.1% of Na
31/164 = 18.9% of P
64/164 = 39% of O