Azure Data Explorer

Power BI is a powerful business intelligence tool that allows users to analyze and visualize data from a variety of sources. One such source is the Azure Data Explorer (ADX), a fast and scalable data analytics platform that is capable of handling large amounts of data in real-time. In this article, we’ll explore the Power Query M Language code needed to connect to the ADX data source from inside Power BI.

What is Power Query M Language?

Azure Data Explorer

Power Query M Language is a functional programming language used by Power Query to transform and shape data. It is based on the F# programming language and is designed to work with a variety of data sources, including databases, web services, and file formats. Power Query M Language is used to create queries that can retrieve, transform, and load data into Power BI.

Connecting to the Azure Data Explorer Data Source

To connect to the ADX data source from inside Power BI, you’ll need to follow these steps:

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

2. Select “Azure” from the list of available data sources.

3. Select “Azure Data Explorer” from the list of Azure services.

4. Enter the URL for your ADX cluster and select your authentication method (either Azure AD or Basic).

5. If you selected Basic authentication, enter your username and password.

6. Click “Connect” to establish the connection.

Once you’ve established the connection, you’ll be able to see a preview of the data in the ADX database. From here, you can select the tables you want to use in your Power BI report.

Using Power Query M Language Code to Connect to the ADX Data Source

If you want to connect to the ADX data source using Power Query M Language code, you’ll need to follow these steps:

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

2. Select “Blank Query” from the list of available data sources.

3. Click on the “Advanced Editor” button in the “View” tab of the ribbon.

4. Enter the following M Language code:


let

Source = AzureDataExplorer.Contents(“https://..kusto.windows.net;fed=true”, ““, ““, [QueryTimeout=#duration(0, 0, 30, 0)]),

#”Expanded Value” = Table.ExpandRecordColumn(Source, “Value”, {“ColumnName1”, “ColumnName2”, “ColumnName3”, “ColumnName4”}, {“Value.ColumnName1”, “Value.ColumnName2”, “Value.ColumnName3”, “Value.ColumnName4”})

in

#”Expanded Value”


Replace the placeholders with the appropriate values for your ADX cluster, database, and query. You can also adjust the query timeout value if needed.

5. Click “Done” to save the M Language code and return to the Power Query Editor.

Once you’ve created the query, you can use it to load data into your Power BI report. You can also modify the M Language code to customize the data transformation process.

Conclusion

Connecting to the Azure Data Explorer data source from inside Power BI is a powerful way to analyze and visualize large amounts of data in real-time. By using Power Query M Language code, you can customize the data transformation process and create more complex queries. With these tools, you’ll be able to create insightful and actionable reports that can help drive business decisions.

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

Contact Us

    Subject

    Your Name (required)

    Company/Organisation

    Email (required)

    Telephone

    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)

    Similar Posts