Forum Discussion
Refreshed date not updated after dataset refresh through XMLA end points
I have not found a solution to the initial question (how to update the Last refresh Date-time shown in Power BI service when running refreshes through XMLA-endpoints), but have taken a few steps on the way to a work around and thought I better share it if it might help someone:
The refresh timestamp set by the xmla-endpoint triggered refresh is possible to fetch through the xmla-endpoints by using this command:
$xmlResult = invoke-ascmd -Server "powerbi://api.powerbi.com/v1.0/myorg/Workspace Name" -InputFile $InputFile -Credential $Credential
Where $InputFile points to a xmla-file containing the following:
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>MDSCHEMA_CUBES</RequestType>
<Restrictions/>
<Properties>
<PropertyList>
<Catalog>Dataset Name</Catalog>
</PropertyList>
</Properties>
</Discover>
and $Credential is created like this:
$userName = "[email protected]"
$password = ConvertTo-SecureString -String "password" -AsPlainText -Force
$Credential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $userName, $password
The return result that ends up in $xmlResult is an xml where you can find LAST_SCHEMA_UPDATE (which is the last refresh date-time stamp that show in Power BI service) and LAST_DATA_UPDATE - which is the date-time stamp that the xmla-triggered refresh ran. Extracting that could potentially be useful for some cases. We however abondoned the idea and exluded our budget queries from incremental refresh to be able to use the built in refresh functionality to be able to trigger subscriptions sent out on data refresh and benefit from the overview you get in the service.