Forum Discussion
Power BI Api approach for dynamic report generation
- 4 years ago
Hi ms92ita,
Yes. You should create a dataset for each customer and then generate an embed token with the right DatasetID.
In addition, you should add the following to the config object:datasetBinding: { datasetId: "<DatasetId>" }See dynamic binding and bind datasets dynamically to a report
Hi ms92ita,
In order to allow users to see shared reports in the PBI Service and connect to shared datasets using PBI desktop, each user must have a user-principal in AAD.
A user-principal can be created in the AAD tenant, or invited from outside the AAD tenant (using Azure B2B which has some limitations- Those will lead to a suboptimal user experience with Power BI Service & Desktop, so you should avoid them).
For this approach you have two options:
1. Each user-principal must have a Power BI license (Pro/PPU).
2. You'll need to purchase a premium dedicated capacity which allows free users access to the reports and datasets.
Since you need to create DQ datasets, you should use a template PBIX file, upload it with the Post Import API then change the connection using the Update Datasources or Update Parameters APIs.
You also have APIs for managing permissions, creating workspaces (one per customer for example. you can use the same premium dedicated capacity for all of them), duplicating reports, and binding reports to datasets. You also have some API control over dashboards, but they are more difficult to manage.
If you need to use a different dataset per customer, you should consider Power BI Embedded. It may better suit your needs (e.g, dynamic binding).