Connecting to and using the REST API in Power BI

Visit Website View Our Posts


Power BI is a cloud-based service to build business intelligence dashboards for your organization. The REST API provides programmatic access to dashboard resources such as Datasets, Tables, and Rows which we can use to create custom apps that push data into a Power BI dashboard.


The REST API currently has the following operations:

  • Dataset operations: Get and create Datasets
  • Table operations: Get Tables and update Table schema
  • Row operations: Add Rows and Delete Rows
  • Group operations: Get Groups
  • Import operations: Create Import, Get Imports, Get Import from GUID, and Get Import by File Path
  • Dashboard operations: Get Dashboards and Get Tiles


We will go over on a technical level how to connect to Power BI API and provide an example of one of the Operations listed above.


Prerequisites: Microsoft.IdentityModel.Clients.ActiveDirectory.dll (this can be downloaded off MSDN)


Connecting to Power BI REST API.
We can create an in house function called AccessToken to give us access to Rest API.



All of the objects you see in this screen shot can be found in the Active Directory library listed above.

Authority =
ResourceURI =
RedirectURI =
Client ID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" (This is the ID you get once you Register your Application).


See: on how to register a client app.


Once this code is run, a screen will pop up and require you to sign in.












Once you sign in, you will now have access to the Rest API for your application.


Using Power BI REST API

In this example we will show how to get groups using the REST API.


We can create an in house function called GetGroups to return all of the Groups within Power BI.



DatasetURI =


These are the class definitions used in the function that were not created by external libraries










Here is the DatasetRequest function definition.

You can call the function like this.


This article was written by Jade Swanson, Technical Consultant for Tridea Partners. Tridea is a leading Microsoft Dynamics provider.

2 thoughts on “Connecting to and using the REST API in Power BI”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Show Buttons
Hide Buttons