Cancer is widely recognised as an evolutionary process. However, despite intense efforts on last years to understand tumour evolution, the importance and extent of darwinian selection and genetic drift on tumourigenesis remains unsolved. Here, we apply a recently developed method to detect selection on cancer cohorts. We reanalysed different datasets including healthy tissue, primary, and metastatic tissue cohorts using two dN/dS methods. We calculated dN/dS in different scenarios, including copy number alterations, clonal versus subclonal variants, and specific gene domain regions such as the immunopeptidome. Moreover, we tested functional terms and discovered a differential set of functions under selection in the primary-to-metastatic transition during tumour evolution. We show that some of these functions have prognostic value and can be used for targeting therapies and delaying the onset of metastasis.