Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I receive the following error when we try to use the models.PageView.fitToWidth setting in an embedded dashboard's configuration details. Is there a setting for dashboards? I'm using v2.0.2 of the power bi api
Unable to get property 'fitToWidth' of undefined or null reference
var config = { type: 'dashboard', tokenType: models.TokenType.Embed, accessToken: accessToken, embedUrl: embedUrl, pageView: models.PageView.fitToWidth, id: embedDashboardId };
Solved! Go to Solution.
@cch1 wrote:
I receive the following error when we try to use the models.PageView.fitToWidth setting in an embedded dashboard's configuration details. Is there a setting for dashboards? I'm using v2.0.2 of the power bi api
Unable to get property 'fitToWidth' of undefined or null reference
var config = { type: 'dashboard', tokenType: models.TokenType.Embed, accessToken: accessToken, embedUrl: embedUrl, pageView: models.PageView.fitToWidth, id: embedDashboardId };
Thanks for reporting that. I can reproduce the same issue. I've found the reason is that the model doesn't contain such "PageView" attribute when trying to debug by "console.log(models);". As a workaround, use the constants "fitToWidth"/"oneColumn"/"actualSize" instead.
@cch1 wrote:
I receive the following error when we try to use the models.PageView.fitToWidth setting in an embedded dashboard's configuration details. Is there a setting for dashboards? I'm using v2.0.2 of the power bi api
Unable to get property 'fitToWidth' of undefined or null reference
var config = { type: 'dashboard', tokenType: models.TokenType.Embed, accessToken: accessToken, embedUrl: embedUrl, pageView: models.PageView.fitToWidth, id: embedDashboardId };
Thanks for reporting that. I can reproduce the same issue. I've found the reason is that the model doesn't contain such "PageView" attribute when trying to debug by "console.log(models);". As a workaround, use the constants "fitToWidth"/"oneColumn"/"actualSize" instead.
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
10 | |
8 | |
5 | |
5 | |
4 |