In FileMaker, a text string containing a field name is not the same thing as a reference to the field itself.
Have you tried this? Evaluate ( "Count ( " & $fieldName & " ) " )
That was it. I had tried Evlauate ( Count ( x ) ) which gave the same ? error. I forget about quotations so that evaluate is just evaluating the text.