I have made an atlas in QGIS 3.6.3 (Noosa) of plant species distributions in two periods of time. Black dots represent distribution in the period 2000-2019 and gray squares represent distribution in the period 1975-1999 (see picture below). In the top part the local (Dutch) name, the scientific name and an ecological group indicator are shown. This is printed automatically using a reference dataset.
I want to print the number of black circles and the number of gray squares as text automatically for every map (1700 maps total). Can this be done without having to calculate it manually? In Excel or R i am able to make a column that specifies the number of occurences in the given period. I could then print this number in the print composer, but the map is still a work in progress and i would not want to manually update it every time i make a change in my dataset (add a new square for a species for example). Hence i would like a way to have the number of features calculated for me automaticcaly whilst generating the Atlas.
Concrete question: How can I print the number of black dots and gray squares in a text block (see example in bottom right of added picture), using the atlas generator in QGIS?
Hope the question is clear enough, otherwise i am open to suggestions.