We study flows of barotropic perfect fluid under the simultaneous action of the electromagnetic field and the axial-vector potential, the external field conjugate to the fluid helicity. We obtain the deformation of the Euler equation by the axial-vector potential and the deformations of various currents by two external fields. We show that the divergence of the vector and axial currents are controlled by the chiral anomaly known in quantum field theories with Dirac fermions. We obtain these results by extending the variational principle for barotropic flows of a perfect fluid by coupling with the external axial-vector potential.