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 / Cant filter Many to Ma...
Power Apps
Unanswered

Cant filter Many to Many relationship

(0) ShareShare
ReportReport
Posted on by 27

I have 2 dataverse tables with a N:N relationship:

CSegares_0-1719423426233.png

 

On a Gallery, I can load Employees correctly, even allows me to get it associated Regions on a subgallery:

CSegares_1-1719423842017.png

 

BUT my problem is when I try to filter the data:

 Filter(
 'Employees' As Employee,
 galRegionFilters.Selected in Employee.'Regions'
 )


 Then it return only "blank" records:

CSegares_2-1719425675929.png

Why is this happening? Is like the Employee.'Regions' is not working as expected.

 

Thanks.

Categories:
  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @CSegares ,

    I am assuming that Regions is the field in the gallery selected record.

    Ungroup(
     ForAll(
     galRegionFilters.Selected As _Data,
     Filter(
     Employee,
     _Data.Regions in Employees.'Regions'
     )
     ),
     Value
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • CSegares Profile Picture
    27 on at

    Hey @WarrenBelz 

    I addapted your code to make it work:

     

    Ungroup(
     ForAll(
     colSelectedFilters As filters,
     Filter(
     Employees As Employee,
     filters in Employee.'Regions'
     )
     ),
     Value
    )

     

    But again, it return Blank records, its like when I try to use this fields: Employee.'Regions' some kinds of bug/error happen on the query and return wrong data. Starting to think Power Apps doesnt like N:N Relationships

     

    However, if I remove that field from the query, it will return valid data:

    Ungroup(
     ForAll(
     colSelectedFilters As filter,
     Filter(
     Employees As Employee,
     Employee.Name = "Carlos"
     )
     ),
     Value
    )

      Thanks for your help!

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    HI @CSegares ,

    You need the field name in the Collection after filter, otherwise you are trying to compare a text value with a Table.

  • CSegares Profile Picture
    27 on at

    colSelectedFilters contains a list of Region, which if am not wrong "in" operator is capable to compare 1:N tables/entitys of the same type (Regions in this scenario)

     

    However I did the change just to test comparing String:

    Ungroup(
     ForAll(
     colSelectedFilters As filter,
     Filter(
     Employees As Employee,
     filter.Name in ShowColumns(Employee.'Regions',Name)
     )
     ),
     Value
    )

     

    The same happens, as long the field Employee.Regions is part of the query, it will fail and fetch empty records:

    CSegares_0-1719458728513.png

     

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @CSegares ,

    Firstly I see a Delegation warning there (which is expected) - how many records are there in Employees ? I also assume that both Name fields are Text - if so

    Ungroup(
     ForAll(
     colSelectedFilters As filter,
     Filter(
     Employees,
     filter.Name in Regions.Name)
     )
     ),
     Value
    )
  • CSegares Profile Picture
    27 on at

    Employees only have 3 Records in total, and Regions 2.

    Just to know, can you replicate this same issue in your environment, am insisting about something wrong with Power Apps when using N:N inside a Filter, look this other scenario:

     

    Scenario 1: Regular equals String filter, 1 result

    CSegares_0-1719466229365.png

     

    Scenario 2: String filter + N:N filter, 1 record returned but all the data blank

    CSegares_1-1719466905396.png

     

    Scenario 3: N:N Filter + String filter, 3 blank results

    CSegares_2-1719467169277.png

    As you can see switching the order of filters affect the result, is like if the N:N filter break something and leave the query result on an invalid status and doenst even evaluate the String filter.

     

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @CSegares ,

    I am using SharePoint, but if both fields are Text, it should work.

  • CSegares Profile Picture
    27 on at

    Well, thats the problem, is not a simple Text : Text comparison.

    One side yes, is a simple Text filter, but the other need to make reference to the N:N feature that Power Apps offers:

     

    CSegares_1-1719498163963.png

     

    Which is the same (or at least that what I thinks) to use Employee.Regions

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard