Azure Cosmos DB v1

Are you looking to connect to Azure Cosmos DB v1 data source from inside Power BI? Then you have come to the right place. In this article, we will discuss the Power Query M Language code for connecting to the Azure Cosmos DB v1 data source from inside Power BI.

What is Azure Cosmos DB?

Azure Cosmos DB v1

Azure Cosmos DB is a globally distributed, multi-model database service designed for high performance and scalability. It allows you to store and access data from anywhere in the world with low latency and high availability. With Azure Cosmos DB, you can store and manage data in a variety of formats including JSON, SQL, NoSQL, Graph, and Table.

What is Power Query M Language?

Power Query is a data connection technology that enables you to discover, connect, combine, and refine data from various sources to meet your analysis needs. Power Query uses a functional language called M to perform data transformations and data modeling.

Connecting to Azure Cosmos DB v1 data source from inside Power BI

To connect to the Azure Cosmos DB v1 data source from inside Power BI, you need to follow the steps outlined below:

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 Cosmos DB” from the list of available Azure services.

4. Enter the connection details for your Azure Cosmos DB account, including the account name, database name, and collection name.

5. Click on the “Connect” button to establish a connection to the Azure Cosmos DB v1 data source.

6. Select the columns and rows that you want to import into Power BI.

7. Click on the “Transform Data” button to open the Power Query Editor.

8. In the Power Query Editor, you can use the M Language code to perform data transformations and modeling.

Power Query M Language Code for Connecting to Azure Cosmos DB v1

To connect to Azure Cosmos DB v1 data source from inside Power BI using Power Query M Language code, you need to follow the steps outlined below:

1. Copy and paste the following M Language code into the Power Query Editor:

“`

let

Source = DocumentDB.Contents(“https://.documents.azure.com”,

[ApiVersion = “2015-04-08”,

Database=”your-database”,

Collection=”your-collection”,

CreateNavigationProperties = true,

Query=”SELECT FROM c”])

in

Source

“`

2. Replace the following placeholders with your own values:

– `` with the name of your Azure Cosmos DB account.

– `your-database` with the name of your database.

– `your-collection` with the name of your collection.

3. Click on the “Done” button to save the changes.

4. Click on the “Close & Apply” button to apply the changes to the Power BI report.

Conclusion

In this article, we discussed the Power Query M Language code for connecting to the Azure Cosmos DB v1 data source from inside Power BI. By following the steps outlined above, you can easily connect to your Azure Cosmos DB v1 data source and perform data transformations and modeling using Power Query M Language. We hope you found this article helpful.

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