Staging queries versus inline queries

  • Rather than creating separate lookup/join staging queries, it's possible to consolidate these expressions into a single let...in M expression
  • For example, the following Employee expression returns the same table as the staging approach described in this recipe
Figure 142: In-Line Query of Employees and Managers
  • The expression in Figure 142 defines a variable expression of ManagerInLine as equivalent to the Employees expression and then joins to this expression
  • Inline query approaches are helpful in limiting the volume of queries but you lose the management benefits provided by group folders and the query dependencies view
  • The graphical support makes it easier to explain and quickly troubleshoot a data retrieval process than a single but complex M expression
  • Staging queries are recommended for projects and retrieval processes of medium or greater complexity
  • These queries should never be loaded to the data model as they could both confuse the user and would require additional resources to process and store by the data model