We study the dynamics of the giant elliptical galaxy M87 from the central to the outermost regions with the made-to-measure ( M2M ) method . We use a new catalogue of 922 globular cluster line-of-sight velocities extending to a projected radius of 180 kpc ( equivalent to 25 M87 effective radii ) , and SAURON integral field unit data within the central 2.4 kpc . 263 globular clusters , mainly located beyond 40 kpc , are newly observed by the Next Generation Virgo Survey ( NGVS ) . For the M2M modelling , the gravitational potential is taken as a combination of a luminous matter potential with a constant stellar mass-to-light ratio and a dark matter potential modelled as a logarithmic potential . Our best fit dynamical model returns a stellar mass-to-light ratio in the I band of M / L _ { I } = 6.0 \pm 0.3 M _ { \odot } / L _ { \odot } with a dark matter potential scale velocity of 591 \pm 50 km s ^ { -1 } and scale radius of 42 \pm 10 kpc . We determine the total mass of M87 within 180 kpc to be ( 1.5 \pm 0.2 ) \times 10 ^ { 13 } M _ { \odot } . The mass within 40 kpc is smaller than previous estimates determined using globular cluster kinematics that did not extend beyond \sim 45 kpc . With our new globular cluster velocities at much larger radii , we see that globular clusters around 40 kpc show an anomalously large velocity dispersion which affected previous results . The mass we derive is in good agreement with that inferred from ROSAT X-ray observation out to 180 kpc . Within 30 kpc our mass is also consistent with that inferred from Chandra and XMM-Newton X-ray observations , while within 120 kpc it is about 20 \% smaller . The model velocity dispersion anisotropy \beta parameter for the globular clusters in M87 is small , varying from -0.2 at the centre to 0.2 at \sim 40 kpc , and gradually decreasing to zero at \sim 120 kpc .