cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kingc5
Level: Powered On

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

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?

 

 

2 REPLIES 2
Super User
Super User

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

@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."

Community Support Team
Community Support Team

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

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,608)