It does not matter as long as your units are consistent for all terms. If you use inches in the M term, you must use inches in the JD term. If you use feet in the M term, you must use feet in the JD term. Same thing for pounds and kips. If you use pounds in the M term, your result P will be pounds. If you use kips in the M term, your result P will be kips.
So, M can be anything; kip-feet, kip-inches, pound-feet, pound-inches, as long as you are consistent for all values in the formula.