Dynamically create a report

Viewed 21

we are trying to implement the following:

We will have PowerBI reports for different scenarios. Each scenario has different data but it will use the same visual for the user.

Therefore, we need to have a "template" report and when a new scenario is created, new report is created from this template together with a new SQL table to which it connects.

I was surprised that it's really difficult to find information how to do this (and I think it's a quite common scenario).

From what I found so far we need to:

  1. Create pbix file which will use power query parameter for data source
  2. Upload this pbix file using REST API
  3. Call REST API to change the parameter to use correct data source

Is that process correct? If so, how to upload a pbix file to a workspace? I found only old tutorials or depricated API.

Thank you for any help.

1 Answers

I was surprised that it's really difficult to find information how to do this (and I think it's a quite common scenario).

Yes. Very common, but not for enterprise or self-service users, so the content can be hard to find.

Check out the Power BI Developer-in-a-day training. This is covered in module 7 Automate Solution Management.

The recommendation there is to deploy the content to a "golden workspace" and then provision a new workspace for each tenant and copy the content into the tenant workspace and configure it there.

You can automate import from the local filesystem too. The API is here, typically here you would use Post Import In Group, as the .pbix would be small.

Related