We present a general method for taking into account correlations due to momentum conservation in the analysis of anisotropic flow. Momentum conservation mostly affects the first harmonic in azimuthal distributions, i.e., directed flow. It also modifies higher harmonics, for instance elliptic flow, when they are measured with respect to a first harmonic event plane such as one determined with the standard transverse momentum method. Our method is illustrated by application to NA49 data on pion directed flow.