High power impulse magnetron sputtering (HiPIMS) is an emerging thin film deposition technology that provides a highly ionized flux of sputtered species. This makes HiPIMS attractive for metal filling of nanosized holes for highly scaled semiconductor devices. In this work, HiPIMS filling with Cu and Co is investigated. We show that the quality of the hole filling is determined mainly by the fraction of ions in the deposited flux and their energy. The discharge waveforms alone are insufficient to determine the ionization of the metal flux. The experimental results are in a good agreement with Monte-Carlo simulations using the measured flux characteristics. Based on the simulations, strategies to improve the filling are discussed.