According to the Apollo Program Summary Report, astronauts on the longer 15-17 missions have difficulties maintaining dietary potassium levels. Section 8.4 claims
Negative nitrogen and potassium balances occurred during the Apollo 17 flight and confirmed a loss in total body protein. In addition, a loss of body calcium and phosphorus was demonstrated. This is consistent with previous flights.
According to section 8.2.6, this resulted in cardiac arrhythmias:
A loss of body potassium during flight was considered to be an important factor in the genesis of the Apollo 15 arrhythmias. As a result, several changes were instituted on Apollo 16 to reduce the likelihood of inflight arrhythmias and to further investigate the causes of body potassium loss during space flight.
Section 8.4 discusses the dietary adjustments to address the problem:
In-suit food bars were used by the Apollo 15 and Apollo 17 lunar module crewmen, and in-suit beverage assemblies were used by the Apollo 16 and Apollo 17 lunar module crewmen. The beverage assembly consisted of a drinking device and a 32-ounce bag containing water or potassium-fortified orange drink.
That "orange drink" was Tang. You can read John Young complaining about it in this answer.
Has potassium loss been an issue in other space programs (e.g. Shuttle, ISS)? What causes the loss: inadequate intake, increased elimination, or some other factor?
Related: Is there any research or recommendations for a diet in microgravity?