@haileym - I am not clear on what you have in the Items property of Dropdown1, but nevertheless, will need to use the AddColumns function to create a "virtual" column which is populated with the display name attribute from your Rep column. You can then run the Sort function on that virtual column. For example:
SortByColumns(
Filter(
AddColumns(
'Feedback Tool 2022',
"RepDisplayName",
Rep.DisplayName
),
Dropdown2.Selected.Value = "-" || Status.Value = Dropdown2.Selected.Value,
Len(Dropdown1.Selected.Value) = 0 || StartsWith(
Rep.DisplayName,
Dropdown1.Selected.Value
)
),
"RepDisplayName",
SortOrder.Descending
)
Note that the AddColumns function is not delegable. However, if you can be certain that filtering on the Status Choice field will always return less than 2000 records, I would suggest using the following pattern instead:
With(
{
_prefiltered_data: Filter(
'Feedback Tool 2022',
Dropdown2.Selected.Value = "-" || Status.Value = Dropdown2.Selected.Value
)
},
SortByColumns(
Filter(
AddColumns(
_prefiltered_data,
"RepDisplayName",
Rep.DisplayName
),
Len(Dropdown1.Selected.Value) = 0 || StartsWith(
Rep.DisplayName,
Dropdown1.Selected.Value
)
),
"RepDisplayName",
SortOrder.Descending
)
)