The Power BI team recently released a new endpoint for the REST API so we can get the Event Activity Log. You can read more about it from their official blog post here (url).
They also made available a PowerShell cmdlets so you can query your data from it but, what if it was easier to get that data straight into Power BI?
That’s exactly what I created – an easier way to get the Power BI Event Activity Log right inside your Power BI Desktop. Before I show you that easier way to get the data, let’s talk about the concept of this new API endpoint (the event activity log).
What Data can I get from event Power BI Event Activity Log?
Let me give you an example of what fields you can actually get from this new endpoint so you can have a better idea:
And in terms of how the data looks like, these are 2 screenshots to give you an idea:
The whole idea is that with this data you can audit what it’s actually happening in your tenant or Power BI workspace level which could be extremely helpful to understand what resources are being used the most and perhaps what resources are simply running just for the sake of running and not adding any value to your solution.
How can I get the data for the Power BI Event Activity Log?
There’s a few ways to get it, but I’ll show you the one that I’ve created through a Power BI Custom Connector and I’ll give you the most important benefits from this solution that you simply can’t get with others.
Get and configure the Custom Connector
The first step is to go get the Power BI REST API Custom Connector and set it up following the documentation found on the official repo here (url).
Launch the Custom Connector and find the Event Activities function
Once you have the Power BI REST API Custom Connector ready, just launch your Power BI Desktop and, after authenticating, in the Navigator window go to the Functions folder and look for the “Event Activity Log” as shown in the next image:
Click on the Transform Data button so you can be taken to the Power Query window.
Entering the date range for your event activity log
This is the first benefit that we get from this Custom Connector that we don’t have with something like the CMDLET. You can select to get data from multiple dates instead of just from one single date.
Just input your start and end date or even use the date pickers and then hit the invoke button so you can start querying the data from the API:
Another hidden benefit of the Custom Connector – is Incremental refresh ready!
Yes! If you’ve read my article about Power BI Incremental Refresh (here) you’ll know that all we need for the incremental refresh to be correctly configured is simply a function that needs a Start and End Date to drive the creation of the partitions.
I can happily say that the function previously mentioned to get the Event Activity Log meets these requirements almost 100%. You still need to use a DateTime parameters and transform those into Date type to be used in the connector, but I’ve tested this, and it simply works!
The Major benefit of this approach – it’s ease of use and integration with Power BI Desktop
While getting the data from PowerShell is quite straightforward, is not as easy as using Power BI Desktop and having the ability to analyze your data right within Power BI Desktop. With other approaches you need to export the response from the API into a file such as a csv, or import the data into another repository.
Excel specialist turned into BI specialist using the latest tools from Microsoft for BI – Power BI. He is the co-author of ‘M is for Data Monkey’, blogger and also Youtuber of powerful Excel video Tricks.