Hi @Tamer66 ,
Do you want to show distinct Mitgliedsnummer value within your Gallery?
Do you want to only show Mitgliedsnummer value within your Gallery?
Based on the formula that you provided, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:
1. If you just want to show Mitgliedsnummer value within your Gallery:
Set the Items property of the Gallery to following formula:
Distinct(
SortByColumns(
If(
!IsBlank(searchField.Text);
Filter(
myContracts;
StartsWith(Nachname; searchField.Text) || StartsWith(Mitgliedsnummer; searchField.Text)
);
Filter(
myContracts;
ArtName = DropdownGew.SelectedText.Value
)
),
"Mitgliedsnummer";
If(SortDescending1; Descending; Ascending)
),
"Mitgliedsnummer"
)
2. If you want to show distinct Mitgliedsnummer value along with other column values within your Gallery, I think an nested Gallery and GroupBy function could achieve your needs:
Set the Items property of the Outer Gallery (Parent Gallery, Gallery1) to following:
GroupBy(
SortByColumns(
If(
!IsBlank(searchField.Text);
Filter(
myContracts;
StartsWith(Nachname; searchField.Text) || StartsWith(Mitgliedsnummer; searchField.Text)
);
Filter(
myContracts;
ArtName = DropdownGew.SelectedText.Value
)
),
"Mitgliedsnummer";
If(SortDescending1; Descending; Ascending)
),
"Mitgliedsnummer",
"GroupData"
)
Then within the Outer Gallery, add a nested Gallery (Gallery2), set the Items property to following:
ThisItem.GroupData
within the nested Gallery, you could add some Label controls to display other column values from your "myContracts" data source using the following formula:
ThisItem.Nachname
ThisItem.ArtName
...
Please take a try with above solution, then check if the issue is solved.
Best regards,