Astragalus membranaceus is a well-known herb that is widely used in the food and pharmaceutical industries. However, its commercial development has been limited due to wild resource shortages. This study was conducted in 2018 and 2019 to assess the effect of planting density on the major chemical compounds and mineral elements and biomass yield of A. membranaceus. The biomass yield (7,700.956 kg) reached the maximum at M2 planting density in 2018. In 2019, astragaloside IV reached its maximum concentration (0.117 %) at M2 group, which was significantly different from the concentrations obtained at the other groups. Calycosin-7-O-β-D-glucoside (0.062 %) reach its maximum concentration in 2019 at M5, but not significant with M2. The concentration of major chemical compounds among the five groups in 2018 and 2019 all conformed to the Chinese Pharmacopoeia standards. In 2018, the mineral elements (Al, Ba, Fe, Li and Mn) content was higher at M2 than other groups. However, a general decrease in the mineral elements content was observed at M2 group in 2019. Enrichment analysis demonstrated that the enrichment capacity was highest for phosphorus. In conclusion, according to the TOPSIS results, M2 planting density was recommended as the optimal application. For optimal economic benefits, A. membranaceus should be harvested when it is 2 years old.