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 / Bug in the Filter Func...
Power Apps
Unanswered

Bug in the Filter Function when filtering with IsBlank()???

(0) ShareShare
ReportReport
Posted on by

Completely baffled as to what is causing my Filter() function to return incorrect results

 

# This results in 78

CountRows(Filter(
'Facilities Contacts',
IDSegment = SelectedSegment &&
StatusCode = "ACTIV" &&
(!IsBlank(PagerEmail) || true)
)) 

 

# This results in 55

CountRows(Filter(
'Facilities Contacts',
IDSegment = SelectedSegment &&
StatusCode = "ACTIV" &&
(!IsBlank(PagerEmail) || false)
)) 

 

# For whatever reason, adding !IsBlank() results in 3. 

CountRows(Filter(
'Facilities Contacts',
IDSegment = SelectedSegment &&
StatusCode = "ACTIV" &&
(!IsBlank(PagerEmail) || !IsBlank(Email))
)) 

 

 See attached images! Either something is wrong with my syntax or something very strange is going on.  

 

The same thing happens for the actual rows returned for the data source. I've tried substituting the logical operators with the logical functions--same result. However, when I paste my actual logic into a text field that's evaluated for each record, it prints the what's expected. Any idea what's going on here?

 

 

pa3.PNG
pa2.PNG
pa4.PNG
Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @kingc5 

    Firstly I noticed this code has a delegation issue.

    CountRows(Filter(
    'Facilities Contacts',
    IDSegment = SelectedSegment &&
    StatusCode = "ACTIV" &&
    (!IsBlank(PagerEmail) || true)
    )) 

     

    How many records are in your SharePoint list.  Have you considered bumping up the delegation limit to 2,000 rows in advanced settings?

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @kingc5 ,

    Could you please share a bit more about the data source used in your formula?

    How many records existed in your data source? More than 2000?

     

    Based on the screenshot that you mentioned, I found that you have faced a Delegation warning issue with your formula. If the amount of your data source records is more than 2000, the Filter formula you provided could only retrieve first 2000 records at most.

    Note: In default, if you have faced a Delegation warning issue in your formula, you could only retrieve first 500 records from your data source. You could change this limit to maximum value -- 2000.

    More details about the Delegation issue in PowerApps, please refer to the following article:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

     

    As an alternative solution, you could consider modify your third formula as below:

    CountRows(
     Filter(
     'Facilities Contacts',
     IDSegment = SelectedSegment,
     StatusCode = "ACTIV",
     Not(IsBlank(PagerEmail) && IsBlank(Email))
     )
    ) 

    or

    CountRows(
     Filter(
     'Facilities Contacts',
     IDSegment = SelectedSegment,
     StatusCode = "ACTIV",
     Not(PagerEmail = Blank()) || Not(Email = Blank())
     )
    ) 

     

    Please make sure you have set the "Data row limit for non-delegable queries" option within Advanced settings of App settings of your app to maximum value -- 2000.

     

    Best regards,

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 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard