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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors