A transition formula for mean values of Dirichlet polynomials