Let $G$ be a finite group of exponent $n$ and let $d\mid n$. Consider the class function $$ f(g) = \begin{cases} 1 & g^d =1\\0&\textrm{otherwise}. \end{cases} $$ As a class function $f$ can be written as $f= \sum_{\chi} c_{\chi} \chi$, with $$ c_{\chi} =\left<f,\chi \right> = \frac{1}{|G|} \sum_{g^d=1} \chi(g) $$ and where $\chi$ runs over the irreducible characters of $G$.
Q. Is there an explicit formula for $c_{\chi}$?
The question is motivated by the fact that when $G$ is cyclic there is a nice formula: Write $n=dk$, then $f = \sum_{\chi^k=1} \chi$.