They can also determine the speed at which the galaxy is rotating from how far the light is shifted. Knowing how fast the galaxy is rotating, they can then figure out the mass of the galaxy mathematically.