Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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,
Solved! Go to Solution.
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
Hi,
We want to try to log the refresh history to external DB Tables. could you share your Powershell logic ?
Thnaks & Regards,
Vishnu Priya
Hi @AnilKumar ,
You can refer the below link to understand the exract of refresh history details.
https://github.com/microsoft/powerbi-powershell/blob/master/examples/Export-RefreshHistory.ps1
I had written a script which exported the data into csv files.
Best Regards,
ankbaner
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
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
User | Count |
---|---|
13 | |
4 | |
2 | |
1 | |
1 |
User | Count |
---|---|
22 | |
3 | |
3 | |
2 | |
2 |