An urgent aim of ecology is to understand how key species relate to climatic and environmental variation, to better predict their prospects under future climate change. The abundant dwarf shrub bilberry (Vaccinium myrtillus L.) has caught particular interest due to its uphill expansion into alpine areas. Species' performance under changing climate has been widely studied using the climatic space-for-time approach along elevation gradients, but potentially confounding, local environmental variables that vary along elevation gradients have rarely been considered. In this study, performed in 10 sites along an elevation gradient (200-875 m) in W Norway, we recorded species composition and bilberry performance, both vegetative (ramet size and cover) and reproductive (berry and seed production) properties, over one to 4 years. We disentangled effects of local environmental variables and between-year, climatic variation (precipitation and temperature), and identified shared and unique contributions of these variables by variation partitioning. We found bilberry ramet size, cover and berry production to peak at intermediate elevations, whereas seed production increased upwards. The peaks were less pronounced in extreme (dry or cold) summers than in normal summers. Local environmental variables explained much variation in ramet size and cover, less in berry production, and showed no relation to seed production. Climatic variables explained more of the variation in berry and seed production than in ramet size and cover, with temperature relating to vegetative performance, and precipitation to reproductive performance. Bilberry's clonal growth and effective reproduction probably explain why the species persists in the forest and at the same time invades alpine areas. Our findings raise concerns of the appropriateness of the climatic space-for-time approach. We recommend including both climatic and local environmental variables in studies of variation along elevation gradients and conclude that variation partitioning can be a useful supplement to other methods for analysing variation in plant performance.