This research proposes an optimized allocation methodology of power quality (PQ) meters in medium voltage (MV) distribution system (DS), considering the potential harmonic resonance conditions. The allocation methodology uses the harmonic resonance mode analysis (HRMA) to calculate the critical modal impedances and identify the harmonic resonance frequencies. Thereby, using the HRMA, it is possible to build a binary observability matrix, which contains the information of nodes' observability for potential harmonic resonance frequencies. The allocation problem is modeled as a constraint integer linear programming that minimizes the number of necessary PQ meters, ensuring the complete observation of the determined harmonic resonance frequencies. The final feasible solution indicates the best locations to install the PQ meters, considering the harmonic resonance conditions, which include distinct operation scenarios of the DS, regarding the capacitor banks of the customers for power-factor correction. The allocation algorithm was applied in two test DSs, based on a CIGRÉ MV network and on the IEEE 34-node test feeder. The results show that four PQ meters are required to completely monitor the potential harmonic resonance frequencies in both the test DSs. It is also shown that the final allocation solution is applicable even for certain variability of the considered capacitor banks.