Low potassium levels or hypokalemia may cause headaches .
More Info: Though headaches are not commonly thought of as a symptom of low potassium, some experts believe there is a connection.
What is Potassium?
Potassium is one of the kinds of electrolytes that compose the cells of your body. An electrolyte is a mineral with electrical properties that affect the way the cells function. Although there are other kinds of electrolytes present in your cells, potassium is considered one of the main electrolytes of the body. Thus, having adequate potassium levels in your body is particularly crucial to ensuring proper muscle contraction and a regular heartbeat . Furthermore, potassium, together with another electrolyte called sodium, regulates the fluid levels inside your cells. Studies have also shown that potassium rich diets are a good way to prevent the incidence of strokes, hypertension and other cardiovascular diseases.
The normal range of potassium levels in your blood is between 3.5 to 5.2 millimoles per liter. 
The Potassium/Ammonia Axis Theory
In his paper “the pathogenesis of vascular headaches in patients with hypertension; the role of the ammonia-potassium axis”, Paul G Cohen MD takes a conceptual approach in the connection between low potassium levels and headaches. Dr. Cohen puts forth the idea that low potassium levels alter the smooth muscle functions in the bowel and bladder resulting in alkaline urine. The presence of hypokalemia with the resulting increased ammonia set off a series of body responses that result in increased blood ammonia and higher than normal brain concentrations of ammonia that can interfere with cerebral blood flow and brain function.
In another paper, Dr. Cohen notes that as many as 25% patients with high blood pressure complain of headaches that have little relationship to actual blood pressure levels. He noted that low potassium levels, increased blood ammonia, and alkaline urine are common patterns in patients with vascular headaches. 
What Causes Low Potassium Levels?
There are many causes to and reasons as to why potassium levels can go below the normal range. Among them are the use of certain antibiotics as well the excessive use of over-the-counter diuretics or water pills and laxatives.
Medical procedures such as bariatric surgery also cause the loss of a lot of potassium in the body, therefore leading to lowered potassium levels. Conditions such as chronic and acute kidney failure, magnesium deficiency, anorexia and bulimia also contribute to low potassium levels. Alcoholism is a cause of hypokalemia.  
How Do You Know if You Have Hypokalemia?
Having a potassium level below 3.6 millimoles per liter is considered as having below normal or low potassium levels. Hypokalemia or the condition of having a very low potassium level is one that is less than 2.5 millimoles per liter. 
  Mayo Clinic
“Low Potassium (Hypokalemia).”
Medical Hypotheses; Cohen PG
The hypokalemic, bowel, bladder, headache relationship; a new syndrome. The role of the potassium ammonia axis.
1984; Volume: 15; No: 2; Pages 135-140
 Medical Hypotheses; Cohen PG
The pathogenesis of vascular headaches in patients with hypertension; the role of the ammonia-potassium axis.
1986; Volume: 21; No: 4; Pages: 377-381
 EMedicine Health
Low Potassium (Hypokalemia) Causes, Symptoms, Diagnosis, Treatment, and Prevention
 National Library of Medicine