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 theory, you can try to create the PBIX dynamically by hacking the file, but this is not supported nor documented.
An easier way will be to use Tabular Editor to manipulate PBIX/PBIT files using C# (it has CLI support).
Note that the Post Import API allows you to overwrite all the existing copies of a dataset. If you plan to create multiple models per customer- This is usually redundant since you should be able to consolidate the logic in a single model (you can consider creating perspectives in the model for a better user experience during report authoring).
If you use a PPU or a premium capacity, I strongly suggest you use the AMO-TOM Assemblies
This will allow you to create/change any dataset structure dynamically (You'll have access to the object model).
If you are implementing Embedding for your organization without PPU or premium capacity, you can consider using an embedded capacity (A SKU) just to have programmatic access during the datasets changes. You can start/stop the embedded capacity and assign/unassign it to a workspace programmatically.