Dear @v-xiaochen-msft
My full gallery code:
If(
!varShowOutOfServiceEmployees,
If(
!IsBlank(varSortByName),
SortByColumns(
Filter(
Trainees,
cref8_outofservice <> 'Out Of Service (Trainees)'.'1' || cref8_outofservice = 'Out Of Service (Trainees)'.'1' && cref8_employmentenddate > Today()
),
"cref8_firstname",
If(
varSortByName,
Ascending,
Descending
),
"cref8_lastname",
If(
varSortByName,
Ascending,
Descending
)
),
!IsBlank(varSortByBudget),
SortByColumns(
Filter(
Trainees,
cref8_outofservice <> 'Out Of Service (Trainees)'.'1' || cref8_outofservice = 'Out Of Service (Trainees)'.'1' && cref8_employmentenddate > Today()
),
"cref8_trainingbudget",
If(
varSortByBudget,
Ascending,
Descending
)
),
!IsBlank(varSortByTrainingDays),
SortByColumns(
Filter(
Trainees,
cref8_outofservice <> 'Out Of Service (Trainees)'.'1' || cref8_outofservice = 'Out Of Service (Trainees)'.'1' && cref8_employmentenddate > Today()
),
"cref8_trainingdays",
If(
varSortByTrainingDays,
Ascending,
Descending
)
),
Trainees
),
If(
!IsBlank(varSortByName),
SortByColumns(
Trainees,
"cref8_firstname",
If(
varSortByName,
Ascending,
Descending
),
"cref8_lastname",
If(
varSortByName,
Ascending,
Descending
)
),
!IsBlank(varSortByBudget),
SortByColumns(
AddColumns(
Trainees,
"cref8_remainingbudget",
ThisRecord.traineeyearlybudget.'Remaining Budget'
),
"cref8_remainingbudget",
If(
varSortByBudget,
Ascending,
Descending
)
),
!IsBlank(varSortByTrainingDays),
SortByColumns(
AddColumns(
Trainees,
"cref8_remainingdays",
ThisRecord.traineeyearlybudget.'Remaining Days'
),
"cref8_remainingdays",
If(
varSortByTrainingDays,
Ascending,
Descending
)
),
Trainees
)
)
My label inside gallery:

The gallery code is not giving any errors.
King Regards,
Anthony