Forum Discussion
Power BI API Integration with C#
This is the Error that I get, and the dataset is a DirectQuery dataset.
{"error":{"code":"InvalidRequest","message":"Invalid dataset. This API can only be called on a DirectQuery dataset"}}
Dear shilpikanade,
These are the steps I followed to solve the similar error:
- From Power BI desktop publish your report. this requires gateway installation. Please follow the instructions from the link below: https://powerbi.microsoft.com/en-us/documentation/powerbi-gateway-onprem/
- Your report is published once this done. see you are able get the report on web.
- Now use the Power BI API code this should render the report/ dashboard without any problem.
- Getting your report on power bi web is important in direct query.
Thanks,
Prasanna V.
- Anonymous8 years agoNot applicable
Hi Prasanna -
Thanks for your reply.
I was able to publish the report and see it on the wen, (app.powerbi.com), and I was also able to access and embed the report in my web app, but I could not change the connection string of the dataset using the API and that's when I get the error. Were you able to get past that error?
Thanks, Shilpi
- send2prasan8 years agoHelper I
Dear Shilpi,
So far I have not seen any one worked on the dynamically changing the data source. I was confident on Power BI API ans MS documentation. but this is not working even for me.
What I could able solve is: if the report is designed on "Database 1" and if that database name is passed dynamically the report seems to be working. the moment I change the database to some other say "Database 2" it threw me error.
All that I am saying is, dynamically changing data source is not working for me either. I am struggling from past 2 weeks. I have raised one more ticket asking for sample if anyone has worked on similar line. Refer this post:
"Power BI API to change Database dynamically"
Thanks,
Prasanna V.
- Anonymous8 years agoNot applicable
Thanks Prasanna, hopefully they'll update the APIs soon.
Thanks, Shilpi