Forum Discussion
Usage Data Won't Refresh
- 1 year ago
Hi dcohare
Sorry the late response and inconvenience caused.
If you prefer not to delete the dataset, you can trigger a refresh using the Power BI REST API.
Please follow the below steps to refresh using the API.
- Register an App in Azure AD.
- Get Workspace & Dataset ID from service.
-
Trigger Refresh using below PowerShell.
********************************************************
$clientId = "YOUR_CLIENT_ID"
$clientSecret = "YOUR_CLIENT_SECRET"
$tenantId = "YOUR_TENANT_ID"
$workspaceId = "YOUR_WORKSPACE_ID"
$datasetId = "YOUR_DATASET_ID"
# Get Access Token
$tokenUri = "https://login.microsoftonline.com/$tenantId/oauth2/token"
$body = @{
grant_type = "client_credentials"
client_id = $clientId
client_secret = $clientSecret
resource = "https://graph.microsoft.com"
}
$tokenResponse = Invoke-RestMethod -Uri $tokenUri -Method Post -Body $body
$accessToken = $tokenResponse.access_token
# Trigger Dataset Refresh
$headers = @{ Authorization = "Bearer $accessToken"; "Content-Type" = "application/json" }
$uri = "https://api.powerbi.com/v1.0/myorg/groups/$workspaceId/datasets/$datasetId/refreshes"
$response = Invoke-RestMethod -Uri $uri -Headers $headers -Method Post
Write-Output "Refresh Triggered"
*******************************************************
- Go to Power BI Service → dataset settings and refresh
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth
Hi dcohare The best option is to delete the current semantic model and recreate the report.
To delete:
Go to the workspace and to the right of any Semantic Model ckick More Options > Settings. Then scroll and click on the Usage Metrics Report Semantic Model. Get the group and dataset ID in the URL.
Then use the Power BI Rest API to delete the dataset.
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/delete-dataset-in-group
After successfully deleting the dataset, recreate the Usage Metrics Report.
https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-modern-usage-metrics
Thanks Wikkleyn_81; there's no solution that doens't include deleting and rebuilding??