The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
is there a way to get similar data to the "New Usage Report" that is created when we choose "View Usage Metrics Report" on a report level but across different workspaces? The data is there, so I guess it is possible getting these through an API so we could create our own reports, but is this documented somewhere?
I have tried the Admin Portal -> Usage statistics but they are not satisfying our needs, we have also got data from the Office 365 Management API but the information there are not that satisfying either. The data points that are shown on individual report level on "New Usage Report" could be useful, as long we get them across the different workspaces. In addition it would be very useful to see which pages people are using on each report as well as capacity consumption per workspace/report/page.
Solved! Go to Solution.
We had the same problem and decided the best approach was to do this ourselves. We wrote some simple PowerShell scripts that connect to the Power BI REST APIs which then pull down the usage metrics. Then we have a SSIS package that picks up that output and loads it into a SQL table which we use going forward to query.
We had the same problem and decided the best approach was to do this ourselves. We wrote some simple PowerShell scripts that connect to the Power BI REST APIs which then pull down the usage metrics. Then we have a SSIS package that picks up that output and loads it into a SQL table which we use going forward to query.
That's great, could you maybe upload these scripts (without sensitive information of course) so I could reuse them with a bit of tweaking?
I guess this is the road we need to go to.
I don't see a way to attach a file here so I'll paste a couple sample scripts here.
1. Usage Metrics Script.....pulls down of yesterday's usage metrics and outputs to csv file
#credentials for connecting to PBI Service
Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint XXXXXX -ApplicationId XXXXXX -Tenant XXXXXX
#get date info for appending to csv export
$CurrentDate = Get-Date
$CD = $CurrentDate.AddDays(-1)
$CurrentDate2 = $CD.ToString('MM-dd-yyyy')
#Get Yesterday's date
$Today = Get-Date
$Yesterday = $Today.AddDays(-1)
#Get dates to use in API and then call API using PBI cmdlet
$startDate = $Yesterday.ToString("yyyy-MM-ddT00:00:00.000")
$endDate = $Yesterday.ToString("yyyy-MM-ddT23:59:59.999")
$Activities = Get-PowerBIActivityEvent -StartDateTime $startDate -EndDateTime $endDate | ConvertFrom-Json
$Activities | Format-Table
#export results to CSV
#INSERT FILE PATH BELOW
$Activities| Export-Csv -Path Z:\Usage_Metrics\PowerBIUsageMetrics_$CurrentDate2.csv -NoTypeInformation
2. Workspace Reports.....loops through each workspace and provides all reports
Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint XXXXX -ApplicationId XXXXX -Tenant XXXXX
#loops through each workspace and grabs reports
Get-PowerBIWorkspace -Scope Organization -Include All -All |
ForEach-Object {
$Workspace = $_.name
$WorkspaceId = $_.Id
foreach ($Report in $_.Reports) {
[PSCustomObject]@{I
Workspace = $Workspace
WorkspaceId = $WorkspaceId
ReportName = $Report.Name
ReportID =$Report.Id}}} | Export-CSV "C:\Script Output\Reports "
@Anonymous
Monitor usage metrics in the new modern workspaces (preview) - Power BI | Microsoft Docs
Regards,
Ritesh