0

i have searched official powerbi docs thoroughly.

There are APIs for creating datasets, updating them and for deleting them. Additionally, there are APIs to clone, update and delete a report.

But after searching a lot, I have not been able to find anything that can help me in creation of a fresh new (visual) report through API?

PS: actually I want to create a visual (not paginated) report without manually going to powerbi desktop or service. I just want to do it with the help of a powerbi rest API.

So is there anyway we can create a new report from existing dataset w/ rest API?

Also, if not possible with rest apis, could this may be possible with powerbi-embedding?

1 Answer 1

2

Yes, it is possible.

  1. First, you need to generate an embed token for report creation from a dataset present in your PBI Service. It can be done by making a POST request to the API from backend.

  2. After that, you can create a new report from that dataset. (Using createReport method in your frontend)

example:

let embedCreateConfiguration = {
    tokenType: tokenType,
    accessToken: accessToken,
    embedUrl: embedURL,
    datasetId: datasetId,
    settings: settings, //optional
    theme: theme, // optional
};

// Grab the reference to the div HTML element that will host the report
let embedContainer = $('#embedContainer')[0];

// Create report
let report = powerbi.createReport(embedContainer, embedCreateConfiguration);

References:

  1. Create, edit, and save an embedded report | Microsoft Learn

  2. Embed Token - Reports GenerateTokenForCreateInGroup - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.