Crystal Palace have completed the signing of defender Joachim Andersen for an initial fee of £14.9million plus £2.1m in add-ons.