Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Good day,
I was recently searching for ways how to include the refresh history in a report and got introduced to the Power BI REST APIs. After playing with the "Try it" function on Microsoft's website I realised this is exactly what I need. I can build a URL using the group and dataset ID, which returns the refresh history as a JSON.
Here is an example of what the URL looks like:
https://api.powerbi.com/v1.0/myorg/groups/group_id/datasets/dataset_id/refreshes
Is it possible to configure the API as a datasource in Power BI? I tried passing the URL as a Web source, but cannot authenticate with either my Windows or Organisational account.
Some forums suggested that I need an Azure app to facilitate the authentication. An app has been registered on the Azure portal and I have the application ID/ token ID/ secret value but I'm not sure how to use this to configure an API call as a data source.
Any help would be appreciated!
Regards
Solved! Go to Solution.
Hi @Anonymous,
You can just use this code to get data from REST API in power query:
let
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/groups/{group id}/datasets/{datasetid}", [Headers=[Authorization="Bearer ************"]])),
value = Source[value],
value1 = value{0}
in
value1
result:
But you should first get the Authorization code. you can use Request URL ID to generate Access Token.
And you can refer this article to get data from REST API.
https://www.sqlshack.com/how-to-access-power-bi-rest-apis-programmatically/
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous,
You can just use this code to get data from REST API in power query:
let
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/groups/{group id}/datasets/{datasetid}", [Headers=[Authorization="Bearer ************"]])),
value = Source[value],
value1 = value{0}
in
value1
result:
But you should first get the Authorization code. you can use Request URL ID to generate Access Token.
And you can refer this article to get data from REST API.
https://www.sqlshack.com/how-to-access-power-bi-rest-apis-programmatically/
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you @v-chenwuz-msft for your inputs.
I tried setting up the datasource as suggested and got the following message:
Did I do something wrong in power query or is it not accepting the access token?
Hi @Anonymous ,
I get the same error message just now, i edit the permission as anonymous .
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
44 | |
20 | |
15 | |
15 | |
15 |
User | Count |
---|---|
35 | |
18 | |
17 | |
17 | |
17 |