web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trouble working with D...
Power Apps
Unanswered

Trouble working with Distinct and Other Columns in Gallery filter

(0) ShareShare
ReportReport
Posted on by 137

Hi PowerApps Community,

 

I am having a little trouble with using Distinct and other columns from a SharePoint list.

 

Basically I have a SP list that has Project numbers, multiple records have that same project number associated.

I have a gallery on the first screen, where i would like to display unique project numbers so that user can click the arrow and the next screen will show the records relating to that project.

 

I had it working using distinct, including a searchbox using this formula: 

Filter(Distinct(AccountsReceivable,Project),StartsWith(Result,SearchProject.Text))

 

Now, I have to add in a Date filter that filters on column "Actual Month" in my SP list.

However, because Distinct returns a table of distinct values, this wont let me work with other columns.

 

Here is the code I have tried and also tried different variations but no luck:

Filter(Distinct(AccountsReceivable,Project),
(DateFilter.Selected.Value="Filter by Date" || Actual Month = DateFilter.Selected.Value) &&
(StartsWith(Result,SearchProject.Text))
))

 

Should I be using a different function that Distinct here? 

 

Any help greatly appreciated!

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @ARAlmac 

    If you want to have two levels of grouping of your data, consider using the GroupBy() function.  You can specify the levels as GroupBy(yourdata,"ColumnName1","ColumnName2","restofdata"). In the example below a contact list is grouped by State and City with the rest of the data shown in a subgallery with the items property, ThisItem.restofdata._1.png

  • AR-29081311-0 Profile Picture
    137 on at

    @Drrickryp Thanks for suggestion,

     

    Group by works, although it still doesnt let me work with the "Actual Month" column from my SP Data in the filter.. I am trying to use group by and also filter by a dropdown of dates.. here is what i have tried:

     

    Filter(GroupBy(AccountsReceivable,"Project","Sales_x0020_Order_x0020_Line","Actual_x0020_Month"),DateFilter.SelectedText.Value = "Filter by Date" || Actual_x0020_Month.'Actual Month' = DateFilter.SelectedText.Value)

     

    It doesnt like the actual month = date filter and says tables can not be used with this operand.. is there a way i can amend this to work with my dropdown filter?

    attaching image to show screen, as you can see multiple projects with same name that need to be distinct

    Capture-Screen.PNG

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard