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 / How to filter distinct...
Power Apps
Unanswered

How to filter distinct records in a gallery in a gallery

(1) ShareShare
ReportReport
Posted on by 53

Hey all,


I have three dataverse tables, Location and Issues, Country

 

Location 

countryID (lookup)          townID (lookup)     titleID (lookup)

1                                       45                                 20

1                                       46                                 21

1                                       47                                 22

2                                       48                                 23

2                                       49                                 24

3                                       50                                 25

3                                       51                                 26

 

CountryDetails

countryID                            description 

1                                       Text description 1

2                                       Text description 2

3                                       Text description 3

 

Town details

townID      issues

45              Text for issue 1

46.             Text for issue 2

47.             Text for issue 2

48.             Text for issue 3

49              Text for issue 4

 

I am trying to display a gallery in a gallery by using the Location table as the data source.  I am trying to show the distinct description in the first gallery and in the second gallery, when a user selects a description, the second gallery shows this issues by filtering the countryID.  The gallery show look like

 

description            Text for issue 

                              Text for issue 

description            Text for issue 

                              Text for issue

                              Text for issue

                              Text for issue

description            Text for issue

 

my code for the items in the second gallery is 

 

Filter(

       Location

             townID = gal_one.Selected.Value

      )

 

Any suggestions on where I am going wrong would be really helpful.

 

thank you for helping.

      

Categories:
I have the same question (0)
  • AmínAA Profile Picture
    1,228 Moderator on at

    Greetings!

     

    I don't seem to have fully grasped what you are trying to achieve there . . . Can you show some images of what you're working in? Also, just in case, I have thought on something that may work for the code you displayed up there. . .

    Filter(
     Location
     townID = gal_one.Selected.Value
     ).'YOUR COLUMN NAME'

     

  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @GreenFrog ,

    To achieve the desired layout for your galleries, where you have a list of descriptions in the first gallery and the corresponding issues in the second gallery based on the selected description, follow these steps:

    1. First Gallery (gal_one) Setup:

      • Set the Items property of the first gallery (gal_one) to show distinct descriptions from the CountryDetails table.

     

    Distinct(CountryDetails, description)

     

     

    Second Gallery (gal_two) Setup:

    • Set the Items property of the second gallery (gal_two) to filter issues based on the selected description from the first gallery. You will need to use the Location, CountryDetails, and TownDetails tables to achieve this.

      Here’s how you can structure the formula for the Items property of the second gallery:

     

    Filter(
     AddColumns(
     Location,
     "countryDescription",
     Lookup(CountryDetails, countryID = Location.countryID).description,
     "townIssues",
     Lookup(TownDetails, townID = Location.townID).issues
     ),
     countryDescription = gal_one.Selected.Result
    ).townIssues

     

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 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard