The research of a generation of ecologists was catalysed by the recognition that the number and identity of species in communities influences the functioning of ecosystems. The relationship between biodiversity and ecosystem functioning (BEF) is most often examined by controlling species richness and randomising community composition. In natural systems, biodiversity changes are often part of a bigger community assembly dynamic. Therefore, focusing on community assembly and the functioning of ecosystems (CAFE), by integrating both species richness and composition through species gains, losses and changes in abundance, will better reveal how community changes affect ecosystem function. We synthesise the BEF and CAFE perspectives using an ecological application of the Price equation, which partitions the contributions of richness and composition to function. Using empirical examples, we show how the CAFE approach reveals important contributions of composition to function. These examples show how changes in species richness and composition driven by environmental perturbations can work in concert or antagonistically to influence ecosystem function. Considering how communities change in an integrative fashion, rather than focusing on one axis of community structure at a time, will improve our ability to anticipate and predict changes in ecosystem function.