Are you using the default export option in Mendix or the Excel Exporer module?
I don't believe it's possible when exporting with the default button in Mendix.
When using the Excel Exporer module, you can do the count in the microflow and use this in the export action.