Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I'm having trouble using the javascript library to embed a visual.
I've successfully embedded whole dashboards with this code:
____________________________________________
var embedConfiguration= {
type: 'report',
tokenType: models.TokenType.Embed,
id: "XXXXXXXXXXXXXXXXXXXXX", // the report ID
pageView: "fitToWidth",
embedUrl: "https://app.powerbi.com/reportEmbed?reportId=XXXXXXXXXXXXXXXXXXXXX",
accessToken: "XXXXXXXXXXXXXXXXXXXXX",
permissions: models.Permissions.All,
viewMode: models.ViewMode.Edit,
//pageName: 'ReportSectionb2cb0b41ed7bcb4c2062',
// pageName = 'ReportSectione8ca3274720a027d512c',
//type: 'visual',
//visualName: '502c9649ae1f8fbe7f07'
};
var $reportContainer = $('#reportContainer');
var report = powerbi.embed($reportContainer.get(0), config);
__________________________________________________________
The report works great, but if I change the type to "visual" by and uncomment the page name and visual name, I can never get a single visual to work.
Anyone know what I might be missing?
Thanks!
Solved! Go to Solution.
Hi @rnehrboss ,
I suggest you to try this code to embed a report visual.
interface IVisualLoadConfiguration {
accessToken?: string;
embedUrl?: string;
id?: string;
pageName: string;
tokenType?: models.TokenType;
type: string;
visualName: string;
}
For more details, you may refer to this offical blog.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @rnehrboss ,
I suggest you to try this code to embed a report visual.
interface IVisualLoadConfiguration {
accessToken?: string;
embedUrl?: string;
id?: string;
pageName: string;
tokenType?: models.TokenType;
type: string;
visualName: string;
}
For more details, you may refer to this offical blog.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
no love here?
Anyone know how?
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 4 | |
| 3 | |
| 2 |