The simplest answer is NEVER - except after adding or removing components to your Phantom.
Almost as it says in the manual for all except the Standard which has not had it's manual updated yet.
Don't calibrate during initial setup, after firmware updates, when flying a new area, each week, month or new flight.
And if you think the app gives an error, you still shouldn't mess with the compass.
The correct action is to move away from the magnetic distortion that your compass has detected.
A compass error isn't a fault with the compass that needs to be fixed.
It's a perfectly good compass telling you that it's detected a problem nearby.
Your compass does not lose its calibration and messing with it will not make your flights safer.
But it can cause problems that may end up with you having one less Phantom.