1) First you should start at the beginning and check this first
@misc wrote:
I can't guarantee how long the data list will be overall, and so I want to avoid using non-delegatable functions where possible, but I thought if I filter it first then do the non-delegatable search on the data returned it will be ok (there will never be over 2000 records under each report type).
Which do you mean?
#1A) Do you mean that a filter query from Power Apps will never return more than 2,000 records?
#1B) Or, do you mean that the total number of records, even without filters, is guaranteed always to be 2,000 or less records?
If you meant A, then watch out. The delegable limit applies not on the maximum filtered number of records that the non-delegable query can return, but actually applies on the total number of records,.
So if you have 2,001 records, only the first 2,000 records are seen and even checked for a match, so 1 record may have a high chance to always be left out of the result altogether, even if it would have matched. If it is the 2001'th record and it matches, a non-delegable query will guarantee that it will always leave it out.
Consider now this example. If you have 10,000 records, only the first 2,000 records are seen, so a whopping 8,000 records may have a high chance to always be left out of the query, even if it would have matched. Suppose that only two of your 10,000 records match the filter - sure, that's below 2,000 records - however, suppose these two records are what PowerApps considers the 9998th and 9999th record. Then a non-delegable query will always skip those records, so there is a guarantee of a match of zero records every time with a non-delegable query, not the expected two records.
Moreover, when attempting to use a delegable query to bring it under 2,000 then use a non-delegable one after that, be very careful with that. It is possible that it will not work as expectedif even a part of the query is non-delegable.
Note that the default is 500 though, not 2,000. We presume you changed it to the max, of 2,000 - remember that the default is actually 500. Even if you changed it to 2,000, you should try to avoid any kind of non-delegable situation altogether.
Also, you want to check the connector documentation for the connector you are using. If the data source is non-delegable, no warning will show, but in that case, it is actually any use of the data source that is a gigantic "delegation warning"
More info on Delegation -> Understand delegation in a canvas app (docs.microsoft.com)
2) Regarding why suggestion from @rsaikrishna did not work in your case:
Actually, we are not so sure why it did not work, other than maybe Item #2B below.
This one we might have to check it further, but it may be related to your data source(s).
#2A) Which data source(s) is/are you using?
#2B) In the data source, does the "Sub-location" actually exist over there? Try to see if checking as the error message suggests and seeing if it may be actually missing from the data source gives any further indication of the issue.
Other than the above, we might need to check on it with more context and information from you.
We might come back and check through your original post in more detail to see if there was anything more that stood out. In meantime @rsaikrishna please feel free to check on it as well and possibly advise @misc of a solution.