i created two Screen with two scrollable gallery the first screenn named " Livrable en attente"
it contains different column from a sharepoint list (Semaine , Description,type ....)

for me the purpuse of the first Screen is to show only the rows with this condition
If(IsBlank(Label16_1.Text) || Label16_166.Text="true" ;true;false)
Label16_1 is Semaine and Label16_166 is Reccurent : which means that if the week is empty and if recuurent true then show me those rows
but in the second screen named " livrable Planifié"

they show me the rows with this condition :
If(!IsBlank(Label16_14.Text)||Label16_28.Text="Cancelled";true;false)
Label16_14 is "Semaine column " the same one
The challenge I'm facing involves the visibility of rows within a gallery when certain conditions are applied. Specifically, I want to ensure that even though some rows might appear blank due to applied conditions, those invisible rows should still be positioned at the bottom of the gallery. However, there's an additional issue related to the code in the "Items" property of the gallery. This code is responsible for implementing a complex filtering mechanism, including sorting rows by ascending date. I'm uncertain about how to address this problem. I need a solution that allows me to keep the blank rows at the bottom of the gallery while preserving the existing code within the "Items" property, which is responsible for filtering and sorting.
the code of my Items property
If(
(IsBlank(DatePicker1_1.SelectedDate) && !IsBlank(DatePicker1_7.SelectedDate)) ||
(!IsBlank(DatePicker1_1.SelectedDate) && IsBlank(DatePicker1_7.SelectedDate));
SortByColumns(
Filter(
test;
IsBlank(ComboBox_Priorité_1.SelectedItems.Value) || IsEmpty(ComboBox_Priorité_1.SelectedItems.Value) || Priorité.Value = ComboBox_Priorité_1.Selected.Value;
IsBlank(ComboBox_type_1.SelectedItems.Value) || IsEmpty(ComboBox_type_1.SelectedItems.Value) || TYPE.Value = ComboBox_type_1.Selected.Value;
IsBlank(ComboBox_nature_1.SelectedItems.Value) || IsEmpty(ComboBox_nature_1.SelectedItems.Value) || Nature.Value= ComboBox_nature_1.Selected.Value;
IsBlank(ComboBox_rsp_1.SelectedItems.Value) || IsEmpty(ComboBox_rsp_1.SelectedItems.Value) || Responsable_Stellanatis.Value = ComboBox_rsp_1.Selected.Value;
IsBlank(ComboBox_anticipe.SelectedItems.Value) || IsEmpty(ComboBox_anticipe.SelectedItems.Value) || Anticipé.Value= ComboBox_anticipe.Selected.Value;
IsBlank(ComboBox_statut_1.SelectedItems.Value) || IsEmpty(ComboBox_statut_1.SelectedItems.Value) || Statut.Value = ComboBox_statut_1.Selected.Value;
IsBlank(ComboBox1_2.SelectedItems.Value) || IsEmpty(ComboBox1_2.SelectedItems.Value) || SemaineProgrammee in ComboBox1_2.SelectedItems ;
StartsWith('Lien DocInfo Fr'; 'LienDoc Fr_1'.Text);
StartsWith('Lien DocInfo EN'; LienDocAn_1.Text);
StartsWith(Titre; Desciption_t_1.Text);
StartsWith(SemaineProgrammee;SemaineP_1)
);
"Date0" ;
SortOrder.Ascending
);
If(
!IsBlank(DatePicker1_1.SelectedDate) && !IsBlank(DatePicker1_7.SelectedDate);
SortByColumns(
Filter(
test;
ThisRecord.Date >= DatePicker1_1.SelectedDate &&
ThisRecord.Date <= DatePicker1_7.SelectedDate &&
IsBlank(ComboBox_Priorité_1.SelectedItems.Value) || IsEmpty(ComboBox_Priorité_1.SelectedItems.Value) || Priorité.Value = ComboBox_Priorité_1.Selected.Value;
IsBlank(ComboBox_type_1.SelectedItems.Value) || IsEmpty(ComboBox_type_1.SelectedItems.Value) || TYPE.Value = ComboBox_type_1.Selected.Value;
IsBlank(ComboBox_nature_1.SelectedItems.Value) || IsEmpty(ComboBox_nature_1.SelectedItems.Value) || Nature.Value= ComboBox_nature_1.Selected.Value;
IsBlank(ComboBox_rsp_1.SelectedItems.Value) || IsEmpty(ComboBox_rsp_1.SelectedItems.Value) || Responsable_Stellanatis.Value = ComboBox_rsp_1.Selected.Value;
IsBlank(ComboBox_anticipe.SelectedItems.Value) || IsEmpty(ComboBox_anticipe.SelectedItems.Value) || Anticipé.Value= ComboBox_anticipe.Selected.Value;
IsBlank(ComboBox_statut_1.SelectedItems.Value) || IsEmpty(ComboBox_statut_1.SelectedItems.Value) || Statut.Value = ComboBox_statut_1.Selected.Value;
IsBlank(ComboBox1_2.SelectedItems.Value) || IsEmpty(ComboBox1_2.SelectedItems.Value) || SemaineProgrammee in ComboBox1_2.SelectedItems ;
StartsWith('Lien DocInfo Fr'; 'LienDoc Fr_1'.Text);
StartsWith('Lien DocInfo EN'; LienDocAn_1.Text);
StartsWith(Titre; Desciption_t_1.Text);
StartsWith(SemaineProgrammee;SemaineP_1)
);
"Date0";
SortOrder.Ascending
);
SortByColumns(
Filter(
test;
//ThisRecord.Date = DatePicker1_1.SelectedDate;
IsBlank(ComboBox_Priorité_1.SelectedItems.Value) || IsEmpty(ComboBox_Priorité_1.SelectedItems.Value) || Priorité.Value = ComboBox_Priorité_1.Selected.Value;
IsBlank(ComboBox_type_1.SelectedItems.Value) || IsEmpty(ComboBox_type_1.SelectedItems.Value) || TYPE.Value = ComboBox_type_1.Selected.Value;
IsBlank(ComboBox_nature_1.SelectedItems.Value) || IsEmpty(ComboBox_nature_1.SelectedItems.Value) || Nature.Value= ComboBox_nature_1.Selected.Value;
IsBlank(ComboBox_rsp_1.SelectedItems.Value) || IsEmpty(ComboBox_rsp_1.SelectedItems.Value) || Responsable_Stellanatis.Value = ComboBox_rsp_1.Selected.Value;
IsBlank(ComboBox_anticipe.SelectedItems.Value) || IsEmpty(ComboBox_anticipe.SelectedItems.Value) || Anticipé.Value= ComboBox_anticipe.Selected.Value;
IsBlank(ComboBox_statut_1.SelectedItems.Value) || IsEmpty(ComboBox_statut_1.SelectedItems.Value) || Statut.Value = ComboBox_statut_1.Selected.Value;
IsBlank(ComboBox1_2.SelectedItems.Value) || IsEmpty(ComboBox1_2.SelectedItems.Value) || SemaineProgrammee in ComboBox1_2.SelectedItems ;
StartsWith('Lien DocInfo Fr'; 'LienDoc Fr_1'.Text);
StartsWith('Lien DocInfo EN'; LienDocAn_1.Text);
StartsWith(Titre; Desciption_t_1.Text);
StartsWith(SemaineProgrammee;SemaineP_1)
);
"Date0";
SortOrder.Ascending
)
)
)
i tried to add this code in sort
"Date0" || IsBlank(Label16_1.Text);
SortOrder.Ascending
);
but they told me that u have a circulaire reference
im Lost could u Help me PowerApps Community
Best Regards Meryem_gz