Precision oncology hinges on linking tumour genotype with molecularly targeted drugs1; however, targeting the frequently dysregulated metabolic landscape of cancer has proven to be a major challenge2. Here we show that tissue context is the major determinant of dependence on the nicotinamide adenine dinucleotide (NAD) metabolic pathway in cancer. By analysing more than 7,000 tumours and 2,600 matched normal samples of 19 tissue types, coupled with mathematical modelling and extensive in vitro and in vivo analyses, we identify a simple and actionable set of 'rules'. If the rate-limiting enzyme of de novo NAD synthesis, NAPRT, is highly expressed in a normal tissue type, cancers that arise from that tissue will have a high frequency of NAPRT amplification and be completely and irreversibly dependent on NAPRT for survival. By contrast, tumours that arise from normal tissues that do not express NAPRT highly are entirely dependent on the NAD salvage pathway for survival. We identify the previously unknown enhancer that underlies this dependence. Amplification of NAPRT is shown to generate a pharmacologically actionable tumour cell dependence for survival. Dependence on another rate-limiting enzyme of the NAD synthesis pathway, NAMPT, as a result of enhancer remodelling is subject to resistance by NMRK1-dependent synthesis of NAD. These results identify a central role for tissue context in determining the choice of NAD biosynthetic pathway, explain the failure of NAMPT inhibitors, and pave the way for more effective treatments.