SortByColumns(
If(
varTabSelected = 3,
Filter( HelpDesk,Gallery3_1.Selected.Value="Open" && Status.Value <> "Resolved" && Status.Value <> "Cancelled" && Status.Value <> "Rejected" ||Gallery3_1.Selected.Value="All" || Status.Value = Gallery3_1.Selected.Value),
Filter( HelpDesk,Gallery3_1.Selected.Value="Open",Priority.Value = "High" && Status.Value <> "Resolved" && Status.Value <> "Cancelled" && Status.Value <> "Rejected" )
),
"ID", SortOrder.Descending)