The coding required for sorting a Power Apps gallery is a bit more complex than you’d expect it to be. This is because the Sort formula cannot include any other operators or functions otherwise delegation issues are likely to be encountered
This means that if you want to give your users the option to sort by 2 or more columns, you can’t include all the options in a single Sort command. If you are new to Power Apps, it can be tempting to creating a series of nested If statements that can be unnecessarily complex to write and debug
The Switch function is a way better alternative!
thanks for the blog. how do I sort by other fields like option and lookup?
Hi Fidel, I’ve a couple of other blogs on sorting other types of dataverse columns
Sorting a Lookup column: https://hiredgun.tech/sorting-a-dataverse-lookup-column
Sorting a Choice column: https://hiredgun.tech/sort-a-dataverse-choice-column/