Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Filter delegating to Dataverse, nested Filter not delegating.

Posted on 28 Nov 2024 11:12:56 by
Hi, my problem is that when I used the Filter function in Power Apps each section on its own works fine in combination with [@PowerBIIntegration].Data when speaking to a Dataverse table with 81288 records. When I use nested filters however the result appears to be acting as if it is not delegating. 
 
To elaborate, the data that is viewed in an embedded Power App in Power BI should only show records where comments are not null. For this I use the following coding:
 
Filter(DVMIBCs, Not (DemandChangeValidation = Blank())) 
 
This line of code works perfectly fine returning the 18 rows where comments are not null.
If I run this code:
 
Filter(DVMIBCs, Brand in [@PowerBIIntegration].Data.Brand) 
 
It searches through the 127 brands and also delegate ok where I can go through all 81288 records in the gallery.
If however I nest functions using:
 
Filter(
Filter(DVMIBCs, Not (DemandChangeValidation = Blank())),
Brand in [@PowerBIIntegration].Data.Brand) 
 
or 
 
Filter(DVMIBCs, Not (DemandChangeValidation = Blank()), Brand in [@PowerBIIntegration].Data.Brand) 
 
I only get two records back.
The above is based on no records being selected in the Power BI drop down for Brand. If I do select one or two brands then that is passed from Power BI through PowerBIIntegration.Data to the Power App that then successfully passes through to Dataverse and returns the few records that have comments for the selected brand. 
 
What confuses me is that yes there are 127 brands but the flow is to process the filtered dataset where there are blanks and that subset dataset is then passed to the outer filter that checks to see if there are any selected brands in the 18 rows from the inner Filter function.
 
Any help would be greatly appreciated, thank you in advance.
Categories:
  • Suggested answer
    jpespena Profile Picture
    jpespena 200 on 28 Nov 2024 at 13:50:10
    Filter delegating to Dataverse, nested Filter not delegating.
    Hi,
     
    Try this:
    With(
         {
         varItems: 
            Filter(
               DVMIBCs, 
               Brand in [@PowerBIIntegration].Data.Brand
            )
         },
         Filter(
            varItems, 
            Not(DemandChangeValidation = Blank())
          )
    )

    If my post helped resolve your issue, please click Accept as Solution—this helps others find it more easily and marks the item as closed. If you found this or my previous reply helpful, a Like would also be appreciated!

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,151

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,845

Leaderboard