Answer
Remove the GROUP BY condition from the Data Source — if the underlying query is already structured to return distinct values (for example using a DISTINCT-style query builder setup), adding a GROUP BY condition on top of that is redundant and breaks the Counter element specifically. Counter elements work correctly once that extra GROUP BY condition is removed, relying on the query's own distinct-value logic instead.