-
Notifications
You must be signed in to change notification settings - Fork 471
Dynamic Binding
| ℹ️ This wiki has been deprecated
|:-----------------------------------------|
All our Client APIs documentation and references can be found in the new Power BI embedded analytics Client APIs documentation set.
For the content of this article see Bind datasets dynamically to a report. |
Each Power BI report is built based on an existing dataset that defines the data schema used in the report visuals.
If you have multiple datasets with the same data schema, a report built on this data schema, can connect dynamically to each dataset to display different insights depending on your needs.
Dynamic binding allows dataset selection on the fly when embedding a report. If you're using dynamic binding, you don't need to create a copy of the same report with a different dataset for each user. One report can serve multiple users.
Using dynamic binding reduces the amount of artifacts that need to be maintained. This improves the application life cycle handling, and makes the onboarding process for new customers simple.
To implement an embedded solution using dynamic binding, add the datasetBinding
property to the embed configuration object, as shown in the example below.
Reports and datasets can be stored in separate workspaces. However, both workspaces must be new workspaces.
When embedding for customers, the embed token must include permissions for both the report and the dynamically bound dataset. Use the new API to generate an embed token which supports multiple artifacts.
When embedding for your organization the user who’s Azure AD token is used, must have appropriate permissions for all artifacts.
var config = {
type: 'report',
tokenType: models.TokenType.Embed,
accessToken: accessToken, // The access token should have permissions for all artifacts
embedUrl: embedUrl,
id: "reportId", // The wanted report id
permissions: permissions,
datasetBinding: {
datasetId: "notOriginalDatasetId", // The wanted dataset id
}
};
// Get a reference to the embedded report HTML element
var embedContainer = $('#embedContainer')[0];
// Embed the report and display it within the div container
var report = powerbi.embed(embedContainer, config);
- The dynamically selected dataset must have the same data schema used in the report.
- When embedding for customers, you'll need to generate an embed token using the new API.
- When embedding for your organization, the user has to have permissions for both the report and dataset.
- Only the new workspaces are supported. The report and datasets must be inside a new workspace.