The (Almost) Definitive Guide to Query Folding
There's only one rule. Don't break the fold! Before we start enforcing all these rules, we should start with something like a solid foundation of what does and doesn't fold in Power Query and their SQL equivalents. Now, if you found this page and we're like "what in the world is query folding?" read this incredible article, from this amazing author.
The disclaimer thing: This is a personal list compiled through testing during the 30-day query folding challenge either done by myself or members of the community (❤️). Every scenario is different, and every situation is unique. The functionality described in this article is subject to change and may evolve over time. Please feel free to leave comments at the end of the article or find me via the social channels to let me know of revisions.
About the data source: The source utilized for these scenarios was an Azure SQL Database or SQL Server. There may not be equal folding functionality within other systems, and you should always test your own solutions to determine full functionality before production use.