Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
darrenfishell
Advocate II
Advocate II

Enable access to usage metric reports across workspaces via UsageMetricsDataConnector.GetMetricsData

There should be a much simpler way to access PowerBI usage data across a given tenant. For my use case, separate workspaces are part of our distribution model to different audiences (via apps). To compare adoption across these audiences, I need to view usage data across workspaces, not one at a time. 

It seems from the Usage Metrics Data sources that this should be easily accessible. 

For instance, here is the PowerQuery script to retrieve the "Report views" table that is used in the default Usage Metrics Report source (BaseUrl = https://WABI-US-NORTH-CENTRAL-C-PRIMARY-redirect.analysis.windows.net)

 

 

 

let
    Source = UsageMetricsDataConnector.GetMetricsData(BaseUrl & "/metadata/v201906/metrics/workspace/" & WorkspaceId & "/reportviews"),
    metricsTable = Table.FromRecords(Source),
    checkForEmptyTable = if Table.IsEmpty(metricsTable) then
                        Table.FromRows
                        (
                            {
                            },
                            {
                                "ReportId", "ReportType", "ReportName", "AppName", "UserKey", "UserId", "UserAgent", "DatasetName", "DistributionMethod", "CapacityId", "CapacityName", "CreationTime", "ConsumptionMethod"
                            }
                        )
                        else
                        metricsTable,
    finalTable = Table.TransformColumnTypes(checkForEmptyTable, {{"CreationTime", type datetime}}),
    #"Renamed Columns" = Table.RenameColumns(finalTable,{{"ConsumptionMethod", "OriginalConsumptionMethod"}}),
    #"Replaced Value" = Table.ReplaceValue(#"Renamed Columns","Apps","App",Replacer.ReplaceText,{"DistributionMethod"})
in
    #"Replaced Value"

 

 

 

UsageMetricsDataConnector.GetMetricsData() should be accessible in Dataflows and/or PowerBI desktop to create custom tenant-wide views of usage data. 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

There is no guarantee whatsoever that the workspace usage metrics datasets will be refreshed or even kept.  Do not base your business processes on these.  Use the tenant audit log instead, it is stored "forever" and can always be retrieved.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

There is no guarantee whatsoever that the workspace usage metrics datasets will be refreshed or even kept.  Do not base your business processes on these.  Use the tenant audit log instead, it is stored "forever" and can always be retrieved.

Much appreciated and very helpful. Thank you!

My confusion about these default Usage Metrics still deepens. Nothing about that data source or presentation seems to follow best BI practices, which is a major gap for a leading BI tool. 

couldn't have said it better...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.