Dremio Cloud

Are you struggling to connect your Power BI reports to the Dremio Cloud data source? The solution to your problem lies in the Power Query M Language Code. In this article, we will explore in-depth how you can use the Power Query M Language code to connect to the Dremio Cloud data source from inside Power BI.

What is Power Query M Language Code?

Dremio Cloud

Power Query M Language is a functional programming language used in Power BI for data transformation and data mashup purposes. It is a case-sensitive language that is used to create custom functions, design queries, and transform data. The M language code is written in a formula bar, and it consists of a series of steps that are executed in sequence to transform data.

Why use Power Query M Language Code?

Power Query M Language Code is a powerful tool that provides flexibility and control for data transformation and cleansing. It allows you to extract data from various sources, transform it, and load it into Power BI reports. By using M Language Code, you can automate repetitive tasks, customize data transformations, and create complex queries.

Connecting to the Dremio Cloud Data Source using M Language Code

To connect to the Dremio Cloud data source, follow these steps:

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

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

3. Enter your Dremio Cloud account credentials and click on “Connect.”

4. Select the desired dataset from the list of available datasets.

5. Choose the desired data transformation options and click on “Load” to load the data into Power BI.

Creating Custom Functions to Connect to the Dremio Cloud Data Source

Power Query M Language Code allows you to create custom functions that can be used to connect to the Dremio Cloud data source. Custom functions make it easier to automate repetitive tasks and create complex queries.

To create a custom function to connect to Dremio Cloud data source, follow these steps:

1. Open Power BI Desktop and select “New Source” from the Home tab.

2. Select “Blank Query” from the list of available query types.

3. In the formula bar, enter the Power Query M Language code to connect to the Dremio Cloud data source. The code should be structured as follows:


let

DremioServer = “https://youraccountname.dremio.com/”,

DremioQuery = “api/v3/catalog/”,

DremioOptions = [

Headers = [

#”Authorization” = “Bearer

]

],

DremioURL = DremioServer & DremioQuery,

DremioData = Json.Document(Web.Contents(DremioURL, DremioOptions)),

DremioTable = Table.FromList(DremioData, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

DremioRecord = Record.Field(DremioTable{0}, “data”),

DremioTable2 = Table.FromList(DremioRecord, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

DremioTable3 = Table.ExpandRecordColumn(DremioTable2, “Column1”, {“id”, “type”, “name”, “createdAt”, “updatedAt”, “path”, “version”, “accelerationSettings”, “datasetType”, “schemaType”, “datasetConfig”, “annotations”, “sql”}, {“id”, “type”, “name”, “createdAt”, “updatedAt”, “path”, “version”, “accelerationSettings”, “datasetType”, “schemaType”, “datasetConfig”, “annotations”, “sql”}),

DremioTable4 = Table.RenameColumns(DremioTable3,{{“id”, “ID”}, {“type”, “Type”}, {“name”, “Name”}, {“createdAt”, “Created At”}, {“updatedAt”, “Updated At”}, {“path”, “Path”}, {“version”, “Version”}, {“accelerationSettings”, “Acceleration Settings”}, {“datasetType”, “Dataset Type”}, {“schemaType”, “Schema Type”}, {“datasetConfig”, “Dataset Config”}, {“annotations”, “Annotations”}, {“sql”, “SQL”}})

in

DremioTable4


4. Save the function and give it a unique name.

5. Use the custom function to connect to the Dremio Cloud data source in your Power BI reports.

Conclusion

Using Power Query M Language Code, you can connect your Power BI reports to the Dremio Cloud data source easily and effectively. With the ability to create custom functions, you can automate repetitive tasks, create complex queries, and customize data transformations. By following the steps outlined in this article, you can take advantage of the full potential of Power Query M Language Code and improve your Power BI reporting capabilities.

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