Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi everyone,
To improve the user experience, I've put a welcome message on the landing page of my report saying "Welcome back, [username]".
I would like the welcome message to only appear when they have not opened the report in let's say more than 72 hours.
Any ideas on how this can be done? Or can I fetch the report views timestamps somewhere so that I can use it in the welcome text measure of my report?
Thanks!
Hi @GKJARC,
Accessing and fetching user report viewing logs is possible by using the Power BI Activity API. The Power BI Activity API allows retrieving detailed activity logs related to Power BI usage, including user-level interactions such as report views, queries, dataset refreshes, and more.
Even we have recently deployed a Power BI Governance Dashboard in our organization which uses Power BI Activity API along with other Power BI Read-Only Admin APIs and Scanner APIs to get our Tenant's activity and catalog data. And we do get Report View logs from our dashboard. The response would look something like this -
While it's possible to obtain report views timestamps for your report, several considerations need to be addressed before implementing a solution -
I hope this provides insight and encourages collaborative efforts in finding a robust solution for your specific use case.
It's technically possible, and there's probably a better way to do it, but below is a powershell script our company runs nightly (using an SSIS job) to get the activity log out of Power BI and into a SQL table on-prem. You'll need to do some research yourself to get it to work, as I'm not too well versed in how it fully functions. Doing it dynamically though like you want may be much more difficult.
# Prerequisits - install Powershell Power Bi modules
# Install-Module -Name MicrosoftPowerBIMgmt.Profile -Force
# Install-Module -Name SqlServer -Force
#Parameters
$TenantId = "INSERT YOUR TENANT HERE"
$AppId = "INSERT YOUR APPID HERE"
$Secret = "INSERT YOUR SECRET HERE"
$ErrorActionPreference = "Stop"
# 1. Login to app.power.bi with Service Prinipal
$password = ConvertTo-SecureString $Secret -AsPlainText -Force
$Creds = New-Object PSCredential $AppId, $password
try {Connect-PowerBIServiceAccount -ServicePrincipal -Credential $Creds -Tenant $TenantId}
catch {throw "Tenant login failed"}
# 2. Get Data from app.powerbi/azure for previous day
$Datum = Get-Date((get-date ).AddDays(-1)) -Format "yyyy-MM-dd"
$StartDate = $Datum + 'T00:00:00'
$EndDate = $Datum + 'T23:59:59'
$json = Get-PowerBIActivityEvent -StartDateTime $StartDate -EndDateTime $EndDate | ConvertFrom-Json
$activity = $json | Select Id, CreationTime,Workload, UserId, Activity, ItemName, WorkSpaceName, DatasetName, ReportName, WorkspaceId, ObjectId, DatasetId, ReportId, ReportType ,DistributionMethod, ConsumptionMethod
# 3. Insert into SQL Server Database
Write-SqlTableData -InputData $activity -ServerInstance "YOUR SQL SERVER" -DatabaseName "YOUR SQL DATABASE" -SchemaName "YOUR DATABASE SCHEMA" -TableName "YOUR TABLE" -Force
Alternatively, there might be a premium/fabric feature that can accomplish this as well.
User | Count |
---|---|
84 | |
80 | |
72 | |
71 | |
55 |
User | Count |
---|---|
108 | |
106 | |
93 | |
85 | |
67 |