Zend certified PHP/Magento developer

In Tableau, when using “Sort By” Field option using a parameter, how can the aggregations (average and sum) be changed as the parameter changes?

I am trying to sort a colored stacked bar chart in my view. I created a "Sort By Dimension" parameter in which I can choose which field I want to sort by. There can be two selections here. For the sorting to work properly, the aggregation for my first selection should be "Sum" and the aggregation for my second selection should be "Average". However, this is not possible to select:

Tableau Sort By Dialogue Box

Is there any workaround to achieve different aggregations for different selections in my parameter?