BI Connector

Power BI is a powerful tool for data visualization and analysis. It provides a wide range of data connectors to connect to various data sources. However, there are situations where you may need to connect to a data source that is not natively supported by Power BI. One such scenario is when you need to connect to a BI Connector data source from inside Power BI. In this article, we will explore how to use Power Query M Language code to achieve this.

What is BI Connector?

BI Connector

BI Connector is a SQL-based data connectivity solution that enables users to connect to a wide range of data sources, including Oracle, MySQL, PostgreSQL, and more, from popular BI tools, including Power BI, Tableau, and Excel. BI Connector provides a bridge between the SQL language and non-SQL data sources, making it easy for users to query and analyze data from these sources using their preferred BI tools.

Connecting to BI Connector from Power BI

To connect to a BI Connector data source from Power BI, you need to follow these steps:

1. Open Power BI and click on the “Get Data” button on the Home tab.

2. In the “Get Data” window, select “Blank Query” under the “Other” category.

3. In the “Query Editor” window, click on the “Advanced Editor” button in the “View” tab.

4. In the “Advanced Editor” window, paste the following M Language code:


Source = Sql.Database(“ServerName”, “DatabaseName”, [Query=”SELECT FROM TableName”])



5. Replace “ServerName” with the name of the server where your BI Connector is installed, “DatabaseName” with the name of the database you want to connect to, and “TableName” with the name of the table you want to query.

6. Click on the “Done” button to close the “Advanced Editor” window.

7. Click on the “Close & Apply” button in the “Query Editor” window to apply the changes.

8. Power BI will now connect to the BI Connector data source and retrieve the data from the specified table.

Understanding the M Language Code

The M Language code used to connect to a BI Connector data source from Power BI consists of two parts:

1. The “Sql.Database” function: This function is used to connect to a SQL-based data source. It takes three parameters: the name of the server, the name of the database, and an optional query parameter.

2. The “let…in” statement: This statement is used to define a query in Power Query. The “Source” variable in the “let” statement represents the data source, and the “in” statement specifies the query to be executed on the data source.


Power Query M Language code provides a flexible and powerful way to connect to a wide range of data sources from Power BI. By using the M Language code to connect to a BI Connector data source, you can leverage the full power of Power BI to analyze and visualize data from non-SQL data sources. With a little bit of M Language code, you can bring new data sources into Power BI and unlock new insights and opportunities for your business.

Power BI Training Courses by G Com Solutions (0800 998 9248)

Contact Us


    Your Name (required)


    Email (required)


    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)

    Similar Posts