Run Power Query M formula language from anywhere.
PowerQueryNet allows you to run M formulas commonly used in Power BI and Excel (aka Get & Transform) from the Command Prompt or any .NET application.
Installer: PowerQueryNet.msi
Dependency: PowerQuerySdk.vsix 1.0.0.16
(Upon installation PowerQuerySdk.vsix
must be in the same folder as PowerQueryNet.msi
)
Samples: PowerQueryNet.Samples.zip
PQNet is a Command Line Interface (CLI) that comes with the installation of PowerQueryNet.
Export the result of a query to several formats (CSV, JSON, HTML, XML)
pqnet "#Hello World.pq" -o json
Export the result of a query to a SQL Server database
pqnet "#Hello World.pq" -s "Data Source=.\SQL2016;Initial Catalog=AdventureWorks2012;Integrated Security=SSPI" -t "dbo.HelloWorld"
Output the result of a Power BI query to file
pqnet MyReport.pbix Query1 -o csv -f result.csv
- Create a new file with the following content:
let Source = "Hello, World!" in Source
- Save the file as helloworld.pq
- Run the following in the Command Prompt:
pqnet helloworld.pq
- From your .NET project, add a reference to
PowerQueryNet.Client
- Run the following:
var qry = new Query { Formula = "let hw = \"Hello World\" in hw" };
var pqc = new PowerQueryCommand() { ExecuteOutputFlags = ExecuteOutputFlags.Csv };
var result = pqc.Execute(qry);
Run queries in a standalone application
- Visual Studio 2015+
To build the Setup project, WiX Toolset must be installed.
Copyright 2019
Licensed under the MIT License