@nmagee
I'm not sure of your understanding of delegation inside of PowerApps but SQL has more delegable queries available to it (notably Search() ) then say SharePoint but not all functions can be delegated, just because it's SQL.
Basically, if a function isn't inside this table (see link) it's not delegable. Even then, there are restrictions
eg Dates: you cannot use '>', '<' to check between dates in SQL, you have to setup your 'dates' as numbers
eg 12/04/2024 as a number is 20240412 - you can then use '>', '<' on this field
https://learn.microsoft.com/en-us/connectors/sql/#power-apps-functions-and-operations-delegable-to-sql-server
A quick check you can do yourself for the Distinct() function is to:
- add a blank gallery, set layout to 'Title'
- connect to your SQL table, if you haven't already - make sure this table has a wide range of records to check Distinct against
- add this Table to the gallery Data Source
- in the app Settings, set the Data row limit to 5 or some smallish number
- back in your gallery, use this function for the Items
Distinct( yourSQLTableName, columnName)
What you will see is that if you are connected to a large table with lots of records and the field you used for columnName has varying values, then the gallery will only display AT MOST 5 records. Galleries done right (eg using Filter) can return ALL the records from a datasource, if the Items function is delegable.
The frustration thing with Distinct is that you don't get a warning to say this and the above method is the only way to check.
The other thing that I find odd about the SQL connector in PowerApps is that Search() is lauded as the must have function when using this data source, and yet you can only use Search() (without delegation issues) on TEXT fields, ie

Anyway, hope this makes sense. Happy to help further if you need me to.