This question already has an answer here:
I am working with QGIS 2.16, and I am wondering if there is a way to include a feature count only for the features displayed in each atlas page. For example, San Francisco only has 120 of a certain feature, while the total count for all metro areas in the dataset is 1500. Is it possible for the atlas page legend to only display the 120 and not the 1500?
Apologies for any lack of clarity. The question is simple but a little hard to explain.