We investigated the association of limited anti-PD-(L)1 treatment duration to therapy efficacy in melanoma and non-small cell lung cancer (NSCLC) patients who received therapy in a non-curative setting in Oulu University Hospital 2014–2022. Here, CD274 is linked to non-small cell lung carcinoma.