Skeletal muscle wasting is considered the central feature of cachexia, but the potential for skeletal muscle anabolism in patients with advanced cancer is unproven. We investigated the clinical course of skeletal muscle wasting in advanced cancer and the window of possible muscle anabolism. We conducted a quantitative analysis of computed tomography (CT) images for the loss and gain of muscle in population-based cohorts of advanced cancer patients (lung, colorectal, and pancreas cancer and cholangiocarcinoma) in a longitudinal observational study. Advanced-cancer patients (n = 368; median survival: 196 d) had a total of 1279 CT images over the course of their disease. With consideration of all time points, muscle loss occurred in 39% of intervals between any 2 scans. However, the overall frequency of muscle gain was 15.4%, and muscle was stable in 45.6% of intervals between any 2 scans, which made the maintenance or gain of muscle the predominant behavior. Multinomial logistic regression revealed that being within 90 d (compared with >90 d) from death was the principal risk factor for muscle loss (OR: 2.67; 95% CI: 1.45, 4.94; P = 0.002), and muscle gain was correspondingly less likely (OR: 0.37; 95% CI: 0.20, 0.69; P = 0.002) at this time. Sex, age, BMI, and tumor group were not significant predictors of muscle loss or gain. A window of anabolic potential exists at defined early phases of the disease trajectory (>90 d survival), creating an opportunity for nutritional intervention to stop or reverse cachexia. Cancer patients within 90 d of death have a low likelihood of anabolic potential.