cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
itsmebvk
Responsive Resident
Responsive Resident

Power BI Admin API Report Refresh Issues

 

Hi Experts,

 

I am trying to create an Power BI audit report as suggested some of the blogs mentioned below. Everything seems to be working in my desktop version, when I publish this report powerbi service (premium workspace)  and try to refresh it, i started getting following error

 

 

Data source error:	Information is needed in order to combine data;Information about a data source is required.. The exception was raised by the IDbCommand interface.
Cluster URI:	WABI-SOUTH-EAST-ASIA-redirect.analysis.windows.net
Activity ID:	XXXXXXXX-84e6-f2e703dd4c82
Request ID:	XXXXXXX-dc504d57c852
Time:	2023-05-04 06:17:19Z

 

https://bielite.com/blog/building-a-power-bi-admin-report/ 

 

https://www.youtube.com/watch?v=cTqFNg_y9lw&list=PLL-WSn9hvefogtxxi7CJhjLCJvrDY0mpQ

 

itsmebvk_0-1683182434921.png

 

When I try to configure credentials I am getting above error, however one of the datasource credentials I was able to setup. But rest two are throwing errors. But it was working without any issues in Power Bi Desktop.  I tried all types of "Authentication Method" but no luck . 😞 . can you please provide any suggestions  or provide any inputs aroudn this issue.

 

1. Working

 

itsmebvk_1-1683182744508.png

 

 

2. Not working

itsmebvk_5-1683182846587.png

 

 

 

3.Not working

 

itsmebvk_6-1683182891882.png

 

 

Thanks in advance.

1 ACCEPTED SOLUTION
itsmebvk
Responsive Resident
Responsive Resident

@ibarrau apologies for the late reply. I was able to resolve this issue by adjusting all privacy level settings to organizational and skip the test connection to the soource which was not allowing .

 

Appreciate for your time and inputs.

View solution in original post

6 REPLIES 6
ibarrau
Super User
Super User

Hi. I'm not totally sure that the code would work, but what you can do is be sure to use the same privacy level for all the credentials sources (like organizational or public) and skip test connections. There are some API sources that can't pass the test but will work any way. If there is a real issue it will show when refreshing.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

itsmebvk
Responsive Resident
Responsive Resident

@ibarrau Thanks for your inputs. Yes I have already tried that method. But no luck 😞 

Then I think the Power Query code of the post it's an approach. Not every develop at Desktop can be on the production environment. What we actually do for activity logs is exporting with a Python library SimplePBI. Then connect PowerBi to that data. 

If you have a requirement for doing it over power query then it might be deep dive research on how to create a code that works on service. Otherwise you can try approaches like python.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

itsmebvk
Responsive Resident
Responsive Resident

@ibarrau agree with you. Can you please provide any blog or reference document which talks about this implementation using python .

 

Thanks in advance.

I think the doc is pretty straight forward.

https://github.com/ladataweb/SimplePBI

You can check how to get the token and use admin requests right there. Getting the activity logs it's an admin request. If you check the example using admin then just look for the correct method for the admin object "a" and capture the result in a variable. I think you can even convert the result from json to pandas (a library for dataframes) in the parameters. It gets a single day or the last 30 in a single line. It handles pagination.

I guess it would be like this:

 

from simplepbi import token
from simplepbi import admin 

TENANT_ID = "XXXXXX"
power_bi_client_id = 'XXXXXX' 

# Regular Login
power_bi_username = 'user@XXXXXX.com'
power_bi_password = 'XXXXXX'
tok = token.Token(tenant_id, app_client_id, username, password, None, use_service_principal=False)

# Service Principal Login
power_bi_secret = 'XXXXXX'
tok = token.Token(tenant_id, app_client_id, None, None, app_secret_key, use_service_principal=True)

# Create admin object
ad = admin.Admin(tok.token)

# Last day pandas response
frame_result = ad. get_activity_events_preview(activity_date="2023-05-03", return_pandas=True)

# Last 30 days pandas response
result = ad.get_activity_events_last_30_days_preview()

 

 

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

itsmebvk
Responsive Resident
Responsive Resident

@ibarrau apologies for the late reply. I was able to resolve this issue by adjusting all privacy level settings to organizational and skip the test connection to the soource which was not allowing .

 

Appreciate for your time and inputs.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors