The selective pressures that determine genotype abundance and distribution frequently vary between ecological levels. Thus, it is often unclear whether the same functional genotypes will become abundant at different levels and how selection acting at these different scales is linked. In this study, we examined whether particular functional genotypes, defined by the presence or absence of 34 genes, of commensal Escherichia coli strains were associated with within-host abundance and/or host population abundance in a wild population of 54 adult mountain brushtail possums (Trichosurus cunninghami). Our results revealed that there was a positive correlation between a strain's relative abundance within individuals and the strain's abundance in the host population. We also found that strain abundance at both ecological levels was predicted by the same group of functional genes (agn43, focH, micH47, iroN, ygiL, ompT, kspmT2 and K1) that had associated patterns of occurrence. We propose that direct selection on the same functional genes at both levels may in part be responsible for the observed correlation between the ecological levels. However, a potential link between abundance within the host and excretion rate may also contribute.