I am trying to sort a gallery which shows meeting but sort the gallery on the organizer's last name which is a look up field to a different CDS entity. I know I could create a collection of all meetings, add the last name column, and modify the items property of the gallery to sort the collection, kind of like this
Ideally I do not want to redo collections because of other dependencies/rework required in the rest of the app. I have tried to combine AddColumns and SortByColumns like this but I haven't had much luck. The error is that the right side of the Equal must be a consistent value on AddColumns
SortByColumns(
AddColumns(
Filter(
[@Meetings],
Or(
'Appointment Status Name' = "Completed",
'Appointment Status Name' = "Cancelled"
)
),
"OrganizerLastName",
Organizer.'Last Name'
),
"OrganizerLastName", Ascending
)
Is it possible to sort on lookup value without a collection?