Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have created a function to call Activity events REST api to get user activity for the last 30 days. FOe Bearer Access token i have created another function. Here is the code -
Get Access Token
Function is working fine and generating bearer access token as shown
Now to get User Activity data using Activity events api i have created a list of dates and two custom columns for startdate and enddate as
Now i have created another function GetActivity to call REST API as -
Now i am adding a custom column in a query to generate the list of user activity data by making a call of this custom function as
In the above snap it is clear that Get Activity function is calling Get Access token function inside to get the Bearer access token and it is picking up the startdate and enddate from the columns defined above , Noiw it should a list activity as shown -
But in my case it is showing this error -
Can anyone help my out to resolve this . I am following Bi Elite video to crteate an admin panel -
This is the link of video
https://www.youtube.com/watch?v=Z4E2jSZ4r6A&list=PLL-WSn9hvefogtxxi7CJhjLCJvrDY0mpQ&index=4
and this is the link of the M code -
https://bielite.com/blog/building-a-power-bi-admin-report/
Thanks in advance
Solved! Go to Solution.
The only difference I can see is in your Get Activity Function
token = Source(continuationToken),
which should be
token = Source[continuationToken],
The only difference I can see is in your Get Activity Function
token = Source(continuationToken),
which should be
token = Source[continuationToken],
Hi @Vera_33 ,
You are right. That was a silly mistake and now eveything is working fine. You are like an angel for me. Thanks a lot sister 🙂
Good practice to type out instead of copy paste all the M code, for the naming of custom function, my personal habit is to prefix with "fx" or "fn", and no space, so it is easier to debug...
Thanks 😊
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.