1

We have a React app.

What I actually want to do is to send JSON to power-bi service, and on the basis of that json data, powerbi service should create a visual/graphical report for me.

I want this whole process to be automated

What I have done so far is-

  1. I have created a push dataset using powerbi REST APIs mentioned in this doc.

https://learn.microsoft.com/en-us/rest/api/power-bi/push-datasets/datasets-post-dataset-in-group

  1. Additionally have created a table inside that dataset through this REST API in the following doc.

https://learn.microsoft.com/en-us/rest/api/power-bi/push-datasets/datasets-post-rows-in-group#code-try-0

Now, what I want is to create a visual report/graph from this table inside this dataset.

There are APIs to clone an existing report. There are APIs to update/delete a report. But I could not find any APIs that can be used to create a report from JSON or from an existing dataset.


MORE-

Additionally in regard to creating a report what i have found is just this page in the whole powerbi docs.

https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/create-edit-report-embed-view?tabs=embed-for-your-organization#how-to-create-a-report

This could be helpful as i also want to embed the created report in my React app at the end.

however I tried it in my react app, and couldn't make it work.

Is this even possible to create a powerbi visual report (not a paginated report) with the help of REST APIs, or they can only be created manually?

Please lead my way!

Andrey Nikolov
  • 12,967
  • 3
  • 20
  • 32
navinrangar
  • 904
  • 10
  • 20
  • https://learn.microsoft.com/en-us/power-bi/developer/embedded/ – Andrey Nikolov Jan 31 '23 at 10:32
  • @AndreyNikolov thanks. gone through there. couldn't find anything in regard. – navinrangar Jan 31 '23 at 11:57
  • Here it is https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core – Andrey Nikolov Jan 31 '23 at 15:54
  • @AndreyNikolov actually i want to create a report directly via an API call? how can I do that? – navinrangar Jan 31 '23 at 17:43
  • It depends what you want to do. You can import an already made report into Power BI - https://learn.microsoft.com/en-us/rest/api/power-bi/imports/post-import-in-group Once embedded you can customize it, change the data source, rebind. Then load the data you want to the data source. All of this is really well documented. But to get more meaningful answers, you have to explain much better what you want to do. "Create report via API call" doesn't give us meaningful information. – Andrey Nikolov Feb 01 '23 at 06:41
  • 1
    i want the whole process to be fully automated. From my app, on a button click i want a dataset to be created in powerbi-service. and then i want to grab it's dataset id and embed URL and be automatically embedded in it's place inside my app. I hope it's more clear now. – navinrangar Feb 01 '23 at 06:50
  • can this help me? pl explain what is this about https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/create-edit-report-embed-view?tabs=embed-for-your-organization#how-to-create-a-report – navinrangar Feb 01 '23 at 06:52
  • @AndreyNikolov i hv reframed question with more details. pl take a look now. – navinrangar Feb 01 '23 at 08:04
  • No, it isn't clear. Are you trying to make another editor and compete with Microsoft? Are you trying to provision a set of predefined reports for a new customer? Creation of a new report is the import API (I gave you the link already). Creation of a new blank report from what you said so far is not what you are looking for, but here it is https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/create-edit-report-embed-view?tabs=embed-for-your-customers – Andrey Nikolov Feb 01 '23 at 11:07
  • @AndreyNikolov have made it more clear. pl take a look – navinrangar Feb 02 '23 at 06:25

1 Answers1

1

PowerBI Rest APIs are used to Manage PowerBI Content, Embed Power BI Content, Perform Admin operations.

Create a Report in Power BI Service:

Follow the documentation to create a report in Power BI service.

Please note that, Currently Power BI service only supports published dataset or pasting or manually entering data in a table. To connect to other resources, download Power BI desktop.

Create a Report in Power BI Embedded:

Power BI Embedded allows us to create, edit and save reports. Please note that, a report can be created in powerbi-embedded only if we have an existing dataset. Refer to this documentation on how to create, edit and save reports in powerbi-embedded.

References:

GitHub - microsoft/PowerBI-Developer-Samples: A collection of Power BI samples for developer use.

Embed Power BI content using a sample embed for your organization application

Embed Power BI content using a sample embed for your organization application

Kotana Sai
  • 1,207
  • 3
  • 9
  • 20
  • thanks for being helpful. but just copying docs here won't help. i hv gone through them. – navinrangar Feb 01 '23 at 06:51
  • Can you please reframe your question in detail ? – Kotana Sai Feb 01 '23 at 07:02
  • i hv added more details. pl take a look now. – navinrangar Feb 01 '23 at 08:04
  • Don't think we have an Rest API for creating report. One workaround I am thinking is to first createreport in your app `powerbi.createReport(element: HTMLElement, embedConfig)`. Save your report and then using `GetReport` Rest API to get the report. – Kotana Sai Feb 01 '23 at 08:37
  • yeah that is what i'm working on currently. can you tell me where do I import this 'powerbi' object from.. is it available in powerbi-client library for react? – navinrangar Feb 01 '23 at 09:42
  • createreport functionality is not yet supported in powerbi-client-react package. `powerbi` is a service. if there is no service provided, you need to create a new service. Refer to [React Wrapper](https://github.com/microsoft/powerbi-client-react). – Kotana Sai Feb 01 '23 at 12:28
  • FYI, there is a open PR on adding `createReport` functionality, to package. you can look into that it will help. – Kotana Sai Feb 01 '23 at 12:29
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/251548/discussion-between-dev-sochokuchnaya-com-and-kotana-sai). – navinrangar Feb 01 '23 at 14:01