Sylius Grid, sort by property that does not exist in entity

Hello everyone, this is my first post, so apologies in advance if it has the incorrect tag.

I have a grid that I created using Sylius that works perfectly.

One of the fields in my grid refers to the count of a collection property (Referees).

I am able to show the count of this collection (Referee Count), but I am unable to sort on on it, because the entity being used to populate the grid does return any sort of count on the collection.

The code looks as follows:

The fields in my grid.yml looks like the below:

>     refereeCount:
>       type: twig
>       label: 'Referee Count'
>       path: 'referees'
>       sortable: ~
>       options:
>         template: AffiliateBundle:admin/referrer:_refereeCount.html.twig

and the refereeCount.html.twig:

>{{ data|length }}`

`As a result, the Gird displays the refereeCount correctly, but I am unable to sort on it.

Does anyone have any advice as to how I would be able to sort on this column?