Hi @PowerSäm
In answer to the first question, I think the easier way to accomplish this is to store the name of the column that you want to sort by in a variable, rather than a different variable for each column.
//To sort by category
UpdateContext({varSortColumn:"Category"})
//To sort by status
UpdateContext({varSortColumn:"Status"})
You can then call the Switch function to specify the course calls to Filter/SortByColumns:
Switch(varSortColumn;
"Status"; <SortByColumns/Filter Status Records>;
"Category"; <SortByColumns/Filter Column Records>;
<Return non filtered collection here>
)
In answer to the second question, if category is also a look up column, you would use the same principle as sorting by status. If you want to match those records where category text equals "Urlaub" or "Dienstreise", you would use the Or/|| operator, rather than specify ["Urlaub";"Dienstreise"]
Filter(AddColumns(....),
CategoryText = "Urlaub" || CategoryText = "Dienstreise"
)