Forum Discussion

AthomePBI762489's avatar
AthomePBI762489
New Member
3 years ago

Power BI rest API Dataset Refresh History report, unable to refresh on Workspace

Hi All,

 

I am trying to put together a Admin Report which shows a comprehensive look into the Existing reports, Datasets and refresh outcomes, 

 

I was able to extract the Admin data using Power BI REST APIs with a refreshable token access on refresh,

Successfulyy able to extrac the data on groups(workspcaes), datasets within each group and reports and users as well,

 

I am unable to Dynamically extract the last N amount of refreshes for each Dataset

 

Right not I am pulling in last 5 refresh history manually by harcoding the dataset ID and appending the queries

 

Is there a way to bypass the Privacy issue and be able to Publish this report on the Admin Woekspace and have it refresh every hour?

 

please help

 

8 Replies

  • Migasuke's avatar
    Migasuke
    Icon for Memorable Member rankMemorable Member

    Hi AthomePBI762489 ,

    Do I understand that you have two problems?
    1. Unable to retrieve refreshes for each dataset.
    2. Keep the reporting updating in PBI service.

    Correct?

     

    • AthomePBI762489's avatar
      AthomePBI762489
      New Member

      Yes,

       

      1. I am able to get refresh data when I Pass a single dataset ID

      I am Trying to get refresh history data for all datasets as a group without having to specify a single dataset at a time.

       

      2. Yes be able to publish this data on a workspace for the team to use

       

       

      • Migasuke's avatar
        Migasuke
        Icon for Memorable Member rankMemorable Member

        Hi again,

        1. Depends what you want to achieve with those Last N refreshes but you might consider this API:
        https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-refreshables

        You need to be admin to use it and generally speaking those Admin APIs are quite powerfull.

        In case you won't find it helpful you need to write a script with a loop where you actually query each dataset separately and merge the responses into one output.
        Basically you will send one request to obtain all Dataset IDs and for each apply the next request.

        2. In case you want to publish the report and keep it up to date by itself I have a bad news for you. It is possible but it requires quite a lot of preparations, which involve lot of Azure resources.

        I can briefly describe the process:
        1. Create and registr your Azure App for authentication.
        2. Create a Azure function or anything where you can run your script in a cloud.
        3. Run your script with authentication using Azure App secret and ID.
        4. Save your API responses in some storage (blob, Azure SQL etc..)
        5. Connect to the storage and then your report can run automaticaly.

        As you can see, it's a quite a lot of time and effort to implement. BUT it is still possible.