As well as the default counts by contest you can apply any filter to an API to return a specific count, similar to a DCount.
To count data use a Custom API with:
Data/count?filter=
You can then apply a regular filter expression such as [Contest]=1AND[Firstname]="Max" however this must be URL encoded.
The example above would become: %5BContest%5D%3D1AND%5BFirstname%5D%3D%22Max%22