Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!