Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

How to get refresh history of dataset using powerbi REST API ?

 I am new to Power BI and still learning about REST API.  I have written powershell script to get the refresh history of a dataset. The script ran but with the output “@odata.context”.  What does the “value” and “id” indicates ? From where can I get refresh history details?  Any suggestion to this matter is highly appreciated.

 

 

Thanks,

  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi Anonymous,

     

    as you can see here the endpoint returns an ODataResponse with the list of refreshes. In the Value field that it's returned you will get an array of Refresh objects which is the Power BI refresh history entry. 

    What you have to do is something like this:

    $refreshesList = Invoke-RestMethod (as you already did)  
    Iterate in $refreshesList.Value and get the properties you need, like $refreshesList.Value[i].endTime, etc.

     

    Of course you can do more things when you invoke an odata endpoint, like filtering and selecting fields (using $filter or $select in the query string of the url that you use) 

     

    Hope this helps.

     

    Regards,

     

    Thanos 

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

     

    as you can see here the endpoint returns an ODataResponse with the list of refreshes. In the Value field that it's returned you will get an array of Refresh objects which is the Power BI refresh history entry. 

    What you have to do is something like this:

    $refreshesList = Invoke-RestMethod (as you already did)  
    Iterate in $refreshesList.Value and get the properties you need, like $refreshesList.Value[i].endTime, etc.

     

    Of course you can do more things when you invoke an odata endpoint, like filtering and selecting fields (using $filter or $select in the query string of the url that you use) 

     

    Hope this helps.

     

    Regards,

     

    Thanos 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous,

       

      Thank you for the reply. $refreshList.Value worked and I get refresh history list of dataset. But is there any possibility to export the list into  a PBI report ? If you can point me to link that would be really helpful.

       

       

      Regards,

      Ankita

       

      • Anonymous's avatar
        Anonymous
        Not applicable
        Hi Anonymous,
        This is a different question than the original one.
        An easy way would be to create a text file from your powershell script and use powerbi desktop to connect to this file and show the Dara.
        There are also other ways but it's out of scope.

        Hope it helps.

        Regards
        Thanos
        Ps: please mark my answer as solution if it helped you solve your issue. In this way we help other users too.
  • Hi,

     

    We want  to try to log the refresh history to external DB Tables. could you share your Powershell logic ?

     

     

    Thnaks & Regards,

    Vishnu Priya