Consider two solutions separated by a semipermeable membrane. This is an important issue. Therefore, to a first approximation you can assume that a given chemical gradient will remain unchanged during the establishment of its balancing, equilibrium electrical potential. If there is less energy in the chemical gradient, it will take less energy in an electrical gradient to balance it. You will not be surprised to learn that biological membranes do not show ideal semipermeability.
Real membranes have a finite permeability to all the major inorganic ions in body fluids.
The Nernst equation, which represents an idealized situation, can be modified to represent the more realistic case in which the membrane shows a finite permeability to these three major players. Click HERE and try the Goldman Equation Simulator. It will help you understand this equation and it's implications for the electrophysiological function of cell membranes. Although under normal physiological conditions the concentration terms of the Goldman equation remain relatively constant, the permeability terms do not. Indeed, large, rapid changes in the ratios of permeability for different ions represent the basis for the control of bioelectric phenomena.