Physical activity

A.
So I noticed that I have a really active lifestyle and am into being athletic and work out...however months when I work out less I get less pain and cramping when I'm on my period than when I work out more, it also meant I can't work out at ALL during my periods or it gets even worse...I was wondering if anyone else was the same as me? I was once told be a PE teacher that physical activity magically fixes period problems but no, it increases them for me.