cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
evalindag
Helper II
Helper II

Filtering a datatable by other datatable with different datasources

Hi everybody

 

I'm trying to filter a datatable by the line chosen in an above datatable. The datatables have different sources but are connected via GroupID. I've added two screenshots of the Power App. 

I want to be able to choose, for example the bottom row in the top table and get all the items that have the same group ID in the bottom table. 

I've tried the following formula: Filter(StarirBookingsV2S, Group = DataTable2.Selected.GroupId) but I get a delegation error. "Delegation warning. The highlighted part of this formula might not work correctly with the column "Group" on large data sets"  

 

Can anybody here help me with this problem I am facing?

 

Best regards

Eva

 

Datatables.pngdatatables2.png

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @evalindag ,

Absolutely - you cannot filter on Lookup columns. I cannot test this, but try

With(
   {wId:DataTable2.Selected.GroupId},
   Filter(
      AddColumns(
         StarirBookingsV2S,
         "vGroup",
         Group.Value
      ),			   
      vGroup = wId
   )
)

 

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.

View solution in original post

6 REPLIES 6
WarrenBelz
Super User III
Super User III

Hi @evalindag ,

Try this

With(
   {wGroup:DataTable2.Selected.GroupId},
   Filter(
      StarirBookingsV2S, 
      Group = wGroup
   )
)

 

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.

Hi @WarrenBelz and thank you for your reply, however I also get the delegation warning while using this formula as you can see in the screenshot

 

2020-09-01_09-20-11.png

 

Best regards

Eva

Thanks @evalindag ,

I thought that would work. What type of field is Group?

@WarrenBelz  It's a Lookup datatype. It gets its value from another entity in CDS through a relationship. Could that be the problem? There is another field called Group ID (Whole number) and has the same value but if I put that instead of Group in the formula it gives me an incompatible type error 

 

2020-09-01_09-48-46.png

2020-09-01_09-52-42.png

 

Best, 

Eva

Hi @evalindag ,

Absolutely - you cannot filter on Lookup columns. I cannot test this, but try

With(
   {wId:DataTable2.Selected.GroupId},
   Filter(
      AddColumns(
         StarirBookingsV2S,
         "vGroup",
         Group.Value
      ),			   
      vGroup = wId
   )
)

 

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.

View solution in original post

Hi @WarrenBelz thank you so so so much, this one worked! 🙂 

 

Best regards

Eva

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,012)