@ArtsyPowerApper shows how to use variables in order to give app consumers the ability to select the column sort order. This can also be done with galleries, but the headers will need to be added above the gallery in that case. The next video will demonstrate dynamic filtering.
Reference:
https://docs.microsoft.com/en-us/powerapps/functions/function-sort