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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Olivierln
Frequent Visitor

Service statistic on Page usage

Dear colleagues,

 

My objective here is to build a report and semantic model that goes behind the classic "power bi usage reports".

 

As of know, we are using the following Activity Log (https://learn.microsoft.com/fr-fr/power-bi/guidance/admin-activity-log#example-1-authenticate-with-t...), but there is no detail of the Report page people view. 

Is there any way to go below, and add the details of the page the report is looking at.

 

Thanks for you help !

1 ACCEPTED SOLUTION

Hi again,

When you turn on logging to Log analytics workspace in Power BI it will log almost everything.

You can customize the extract, so it returns exactly what you want. In my project I use this KQL:

PowerBIDatasetsWorkspace
| where TimeGenerated >= startofday(ago(1d)) and TimeGenerated < startofday(ago(0d))
| extend ParsedContext = parse_json(ApplicationContext)
| extend DatasetId = tostring(ParsedContext.DatasetId)
| where isnotempty(DatasetId)
| extend ReportId = tostring(ParsedContext.Sources[0].ReportId)
| extend VisualId = tostring(ParsedContext.Sources[0].VisualId)
| extend UserSession = tostring(ParsedContext.Sources[0].HostProperties.UserSession)
| where isnotempty(UserSession)
| extend DateTime = bin(TimeGenerated, 1m)
| extend Date = format_datetime(TimeGenerated, 'yyyy-MM-dd')
| summarize Sessions = dcount(UserSession) by
Date,
DateTime,
PowerBIWorkspaceId,
PowerBIWorkspaceName,
DatasetId,
ReportId,
VisualId,
ExecutingUser,
UserSession

Then you can connect this to the ActivityEvent API if you like. The KQL returns:

mariussve1_0-1720172359188.png


As you can see, this returns one row for each sessionid pr visual id that the end user have visited 🙂 This is just what you want.

Br
Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no

View solution in original post

4 REPLIES 4
mariussve1
Super User
Super User

Hi,

 

If you think my answer provided some kind of a soulition, please consider accepting it as soulition and click the button. I also greatly appreciate if you give me a kudos 🙂

 

Br

Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no
Olivierln
Frequent Visitor

Hi, 
Thanks for you feedback. 
but here it seems like we are discussing the Metadata not the activity log (xxxx@gmail.com views the page xxx of the report yyy), isn 'it ?

Hi again,

When you turn on logging to Log analytics workspace in Power BI it will log almost everything.

You can customize the extract, so it returns exactly what you want. In my project I use this KQL:

PowerBIDatasetsWorkspace
| where TimeGenerated >= startofday(ago(1d)) and TimeGenerated < startofday(ago(0d))
| extend ParsedContext = parse_json(ApplicationContext)
| extend DatasetId = tostring(ParsedContext.DatasetId)
| where isnotempty(DatasetId)
| extend ReportId = tostring(ParsedContext.Sources[0].ReportId)
| extend VisualId = tostring(ParsedContext.Sources[0].VisualId)
| extend UserSession = tostring(ParsedContext.Sources[0].HostProperties.UserSession)
| where isnotempty(UserSession)
| extend DateTime = bin(TimeGenerated, 1m)
| extend Date = format_datetime(TimeGenerated, 'yyyy-MM-dd')
| summarize Sessions = dcount(UserSession) by
Date,
DateTime,
PowerBIWorkspaceId,
PowerBIWorkspaceName,
DatasetId,
ReportId,
VisualId,
ExecutingUser,
UserSession

Then you can connect this to the ActivityEvent API if you like. The KQL returns:

mariussve1_0-1720172359188.png


As you can see, this returns one row for each sessionid pr visual id that the end user have visited 🙂 This is just what you want.

Br
Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no
mariussve1
Super User
Super User

Hi,

 

I have started on this project myself, and its not strait forward, but doable.

 

First you need to do is enable logging to Log analytics:

https://learn.microsoft.com/en-us/power-bi/transform-model/log-analytics/desktop-log-analytics-overv...

Log analytics fetch the visual id. To map this the correct page you need to use an api to Get report definition:

https://learn.microsoft.com/en-us/rest/api/fabric/articles/item-management/definitions/report-defini...

Im using notebook and a Python script to convert the respons:

"payload": "base64 encoded string

 

I save this json respons to a file on onelake and Then use a new pythoncript to scan and Get all the visual id and wich page it belongs to.

 

Then at last I load the kql query from log analytics with the relevant info and map it to the Python extraction in power bi and create a report.

 

As I said, not Strait forward but doable.

 

Br

Marius 🙂


Br
Marius
BI Fabrikken
www.bifabrikken.no

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 MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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