That can certainly be! I've become really happy for magnesium oil (magnesium chloride flakes in water as a spray). Have tried: Mg malate, oxide, taurate, hydroxide, citrate and chloride as oral supplements.
My votes on the best in this order:
Magnesium oil because you don't have to swallow it, and you get a lot more in
Magnesium taurate (Douglas Labs) for gentleness and effect on relaxing the head from migranes
Magnesium malate (source naturals) relaxes the liver