The interplay between superconductivity and any other competing order is an essential part of the long-standing debate on the origin of high temperature superconductivity in cuprates. Akin to the situation of heavy fermions, organic superconductors and pnictides, it has been proposed that the pairing mechanism in cuprates comes from fluctuations of a nearby quantum phase transition. Recent evidence of charge modulation and the associated fluctuations in the pseudogap phase of YBa_2Cu_3O_y make charge order a likely candidate for a competing order. However, a thermodynamic signature of the charge ordering phase transition is still lacking. Moreover, whether such charge order is one- or two-dimensional is still controversial but pivotal for the understanding the topology of the reconstructed Fermi surface. Here we address both issues by measuring sound velocities in YBCO_6.55 in high magnetic fields, a powerful thermodynamic probe to detect phase transitions. We provide the first thermodynamic signature of the field-induced charge ordering phase transition in YBCO allowing construction of a field-temperature phase diagram, which reveals the competing nature of this charge order. The comparison of different acoustic modes indicates that the charge modulation has a two-dimensional character, thus imposing strong constraints on Fermi surface reconstruction scenarios.