Hi,
There is no aggregate function in datagrid 2.
Check the below link for alternate way
I hope Mendix adds ths kind of functionality like we had in the old datagrid.
This is definitely worth an entry in the idea forum:
https://forum.mendix.com/link/space/widgets/ideas/4081