Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a PBI report which displays information from our nightly data pipelines. I'd like to show the last refresh date for datasets in the PBI service. I see the REST api has a resource for this (https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getrefreshhistory), how can I use the REST api as a data source?
Hi @michaelccdf
Load the Power BI pbix file associated with your view in Power BI Desktop.
In the External Data section of the ribbon, choose Edit Queries and Open Advanced Editor.
If you have not already modified the query you should see text below with specific table values matching your Analytics view.
let
Source = VSTS.AnalyticsViews("{OrganizationName}", "{ProjectName}", null),
#"{tableid}_Table" = Source{[Id="{tableid}",Kind="Table"]}[Data],
in
#"{tableid}_Table"Modify the query as follows:
let
Source = VSTS.AnalyticsViews("account", "project", null),
#"{tableid}_Table" = Source{[Id="{tableid}",Kind="Table"]}[Data],
#"Added Refresh Date" = Table.AddColumn(#"{tableid}_Table", "Refresh Date",
each DateTimeZone.FixedUtcNow(), type datetimezone)
in
#"Added Refresh Date"Important
These examples use UTC. You can adjust the query code based on your specific timezone as described in DateTimeZone function
When finish, choose Done.
Choose Close & Apply to immediately refresh the dataset.
Identify the Refresh Date column under the field.
Add the field to a card to see the last refresh date on your reports.
Thanks for this, however I'm not clear on what Azure DevOps Analytics views has to do with the PBI REST api. I'm trying to get the refresh history for my PowerBI datasets into a Power BI report. One way to do it would be to download the data from the PBI REST API, load it into a database and then have the database as a data source in PBI.
Just wondering if there is a way to use the PBI REST api as a datasource directly, without having to download to a database first.
Hi @michaelccdf ,
Please refer to the link.
How to import REST API in Power BI (Load JSON / SOAP XML)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 26 |