@PapaChanoli, yes I was taking magnesium also. Every day, for years. But it was in pill form, and found out that the main form was magnesium oxide, the form that is the least bioavailable to the body, which can absorb only about 4% of mag oxide. I was taking 800 mg per day, in divided doses. To no effect.
If I took more, then yes the body expelled the overload that was not absorbed.
The answer for me was: I switched to a liquid form called ReMag (I’m sure there are other similar brands, I just haven’t researched them). It is picometer sized, and the body absorbs it well before it even reaches the lower bowels, where magnesium can put things in overdrive.
I started slow, at 1/8 teaspoon, put into water, sipped thru the day. All was well. Increased to 1/4 t, then 1/2 t. Still no problems. I plan to work up the the therapeutic dose of about 1 teasp, 3x/day, which equals about 900 mg. (or to bowel tolerance, whichever comes first).
To find relief and healing is worth the extra cost to me, since this has been YEARS of painful muscle issues. The makers of it say to work up dosage slowly, because it activates many many processes that have been starved for magnesium, and you don’t want to feel worse before you feel better.
I totally got that concept. Same thing with stuff like keto flu when first starting. 
I read the book about magnesium that really helped me figure it out: The Magnesium Miracle by Dr Carolyn Dean (the updated & revised version). In it are lists of things that affect magnesium levels, such as which prescriptions. Things like diuretics, blood pressure rx’s, antiacids, laxatives, meds for diabetes, certain antibiotics, etc etc.
It also covers various types of magnesium, and their affects on the body (which have a laxative affect, etc).
Here is one part that particularly struck me, talking about the importance of both calcium and magnesium, and what happens if one gets too low on magnesium:
“If calcium accumulates in the cells, it causes hyperexcitibility and calcification and disrupts cell function. Too much calcium entering cells can cause symptoms of heart disease (such as angina, high blood pressure, and arrhythmia), asthma, or headaches. Magnesium is nature’s calcium channel blocker.”
https://smile.amazon.com/Magnesium-Miracle-Revised-Updated/dp/034549458X/ref=sr_1_1?s=books&ie=UTF8&qid=1492294473&sr=1-1&keywords=the+magnesium+miracle+revised+and+updated+2014+edition