Following a number of conflicting studies of M87's mass profile, we undertake a dynamical analysis of multiple tracer populations to constrain its mass over a large radius range. We combine stellar kinematics in the central regions with the dynamics of 612 globular clusters out to 200 kpc and satellite galaxies extending to scales comparable with the virial radius. Using a spherical Jeans analysis, we are able to disentangle the mass contributions from the dark and baryonic components and set constraints on the structure of each. Assuming isotropy, we explore four different models for the dark matter halo and find that a centrally-cored dark matter distribution is preferred. We infer a stellar mass-to-light ratio $\Upsilon_{\star,v} = 6.9 \pm 0.1$ -- consistent with a Salpeter-like IMF -- and a core radius $r_c = 67 \pm 20$ kpc. We then introduce anisotropy and find that, while the halo remains clearly cored, the radial stellar anisotropy has a strong impact on both $\Upsilon_{\star,v}$ and the core's radius; here we find $\Upsilon_{\star,v} = 3.50_{-0.36}^{+0.32}$ -- consistent with a Chabrier-like IMF -- and $r_c = 19.00_{-8.34}^{+8.38}$ kpc. Thus the presence of a core at the centre of the dark halo is robust against anisotropy assumptions, while the stellar mass and core size are not. We are able to reconcile previously discrepant studies by showing that modelling the globular cluster data alone leads to the very different inference of a super-NFW cusp, thus highlighting the value of multiple-population modelling, and we point to the possible role of M87's AGN and the cluster environment in forming the central dark matter core.