Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
2 | |
2 | |
1 | |
1 |