We present new results on ionization by electron impacts in a dense plasma. We are interested in the density effect known as ionization potential depression and its role in atomic structure. Rather than using the wellknown Stewart-Pyatt or Ecker-Kröll formulas for the ionization potential depression, we consider a distribution function of the ionization energy, which involves the plasma fluctuations due to ion dynamics. This distribution is calculated within classical molecular dynamics. The removal of the noise yields a new distribution which is composed of a small set of Gaussian peaks among which one peak is selected by considering the signal-to-noise ratio. This approach provides an ionization potential depression in good agreement with experimental results obtained at the Linac Coherent Light Source facility. Our results are also compared with other calculations. In a second part, we investigate the effects of the ionization potential depression and the fluctuations on ionization by electron impacts. We propose an expression of the cross section that is based on an average over the ionization energy distribution. This cross section can be calculated analytically. The main strength of our work is to account for the fluctuations due to ion dynamics.