Sort two parameters inside data

The SQL equivalent of what the OP wants to achieve is:

SELECT * FROM .Site.Data.portfolio_residential ORDER BY favorite ASC, project_name ASC;

As far as I know this is not easily achievable. When sorting pages you can use nested .ByParam calls, but not when working with data files.

You may be able adapt this to your use case, but it’s complicated: