Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
kmurugadhas87
New Member

Unable to retrieve dataset refresh history

Hello Team,

 

I am trying to get the refresh using the API `https://api.powerbi.com/v1.0/myorg/admin/datasets/<sanitized_the_dataset_id>/refreshes` and it says "Couldn't find dataset id"..

kmurugadhas87_0-1664889351846.png

 

However when I try to retrieve the dataset information using `https://api.powerbi.com/v1.0/myorg/admin/datasets/<sanitized_dataset_id>` I am able to retrieve the dataset successfully.

 

kmurugadhas87_1-1664889698448.png

 

I would like to know, why I am not able to get the Dataset refresh history?

 

8 REPLIES 8
alexgor87
Advocate II
Advocate II

Hi all, I have a similar issue and MS support confirmed that these are non-admin APIs:
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/get-refresh-history
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes?$top={$top}
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/get-refresh-history-in-group
GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshes?$top={$top}

The workarounds are:
1. Assign service principal to all workspaces explicitly. You might face a throttling error 429 when you exceed the number of requests per hour.
2. Get refreh date for all datasets in all workspaces from Activity Event Log (as far as I know - we can look at the last 30 days). https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-activity-events
3. Depending on your task - Get Unused Artifacts As Admin might help to see if any datasets have not been used in the last 30 days. https://learn.microsoft.com/en-us/rest/api/power-bi/admin/groups-get-unused-artifacts-as-admin

 

Please vote for the idea to have admin API: Get Refresh History as Admin:
https://ideas.powerbi.com/ideas/idea/?ideaid=7d09ec1a-52f8-ed11-a81c-000d3adaa5b3

Anonymous
Not applicable

Hi,

 

 

Same happens to me. I am creating a function in Power BI to use the datasetid and retrieve the refresh history for all my datasets:

get refresh history = (datasetid as text)=>
let
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/",
[
RelativePath="admin/datasets/"& datasetid &"/refreshes",
Headers=[Authorization="Bearer "&GetToken()] ] ))
in
#"Source"

I am calling this function when I retrieve a list with all my dataset ids from all workspaces. 

 

In Power BI I receive this error: DataSource.Error: Web.Contents failed to get contents from 'https://api.powerbi.com/v1.0/myorg/admin/datasets/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/refreshes' (404): Not Found

 

Once I try the same api call with the same dataset id in Postman, it works fine, I can see all the information. 

 

In both Power BI and Postman I use Bearer Token, so the authentication is the same.

This api used to work almost a year ago. Do you have any idea if there is any similar api I could use instead?

collinq
Super User
Super User

Hi @kmurugadhas87 ,,

 

is this a Direct Query refresh?  If so, you may need to use this one: Datasets - Get Direct Query Refresh Schedule - REST API (Power BI Power BI REST APIs) | Microsoft Le...

 

Is it OneDrive?  That API command limitation is taht OneDrive refresh history is not returned.

 

I am not sure if it is a big thing or not, but the sample code I found is "GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes" whereas you have https://api.powerbi.com/v1.0/myorg/admin/datasets/<sanitized_dataset_id>` 

I am wondering if the "admin" is an issue?




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




MASF
Frequent Visitor

Hello @kmurugadhas87 did you manage to find a solution to retrieve the dataset refreshes? 

Other than adding the admin account to each workspace, i could not find any other solution so far ....

 

Hello @collinq 

The refresh type is  "Scheduled" and also "OnDemand". The below call seems to be working fine earlier and all of a sudden this stopped working. So trying to figure out the root cause.

 

https://api.powerbi.com/v1.0/myorg/admin/datasets/<sanitized_dataset_id>/refreshes

 

Tried without Admin also but it gives the same error message

 

{
"error": {
"code": "ItemNotFound",
"message": "Couldn't find dataset id "
}
}

Hey @kmurugadhas87 ,

 

Let's back up a step, when you run this command, does it list this particular dataset?  "GET https://api.powerbi.com/v1.0/myorg/admin/datasets"

I know that you are getting it through the direct dataset command but I am curious if it lists this way as well.




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




Hello @collinq,

 

Yes, I am able to that API call and results are returned as expected

 

kmurugadhas87_0-1664990963212.png

 

I am wondering why the below API call stopped working recently. This has been working for us successfully for years and just stopped working somewhere around July / August 2022.

 

https://api.powerbi.com/v1.0/myorg/admin/datasets/$datasetid/refreshes

 

From Admin section in the documentation, now I don't see this API call. May be Microsoft removed this API recently from Admin ??

 

https://api.powerbi.com/v1.0/myorg/admin/datasets/$datasetid/refreshes

 

Documentation: https://learn.microsoft.com/en-us/rest/api/power-bi/admin

Hey @kmurugadhas87 ,

 

Maybe they did.  I am not sure how to find out, I looked for "deprecated API" and couldn't find anything that was any sort of list.  Perhaps a ticket to Microsoft to ask them?  And, if you do get a response from them, please let us know.




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.