Updated on

SqlExpression.ToExpression is a Power Query M function that serves the purpose of transforming the given SQL query into M code, utilizing the identifiers accessible within the environment.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365


   sql as text,
   environment as record,
) as text


Converts the provided sql query to M code, with the available identifiers defined by environment. This function is intended for internal use only.

Other functions related to SqlExpression.ToExpression are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/sqlexpression-toexpression