Forum Discussion
MobilePortrait layout renders differently in JavaScript SDK embed vs Power BI Service
Hi rafaelmpsantos,
From the screenshots and the behavior you're seeing, this seems more tied to how the report renders in the embedded mobile experience than to the embed configuration itself. The layoutType: models.LayoutType.MobilePortrait setting loads the report's mobile layout, but visuals like button slicers, tables, and matrices can still behave differently when embedded, which can lead to truncated text, clipped columns, or scaling differences.
Since you've already tested container sizing, FitToWidth, FitToPage, isMobile=true, and the viewport settings, you've covered most of the common configuration options. As a next step, I'd recommend trying the latest powerbi-client SDK version to see whether there are any rendering improvements.
If the behavior stays the same, it may be worth validating the report specifically in the embedded scenario and adjusting the mobile layout where needed. For example, responsive visuals or dropdown slicers may work better than button-grid slicers, and wide matrix/table layouts may need to be simplified for smaller screens.
Best practices for creating mobile-optimized Power BI reports - Power BI | Microsoft Learn
Optimize visual formatting for mobile layout - Power BI | Microsoft Learn
Embedding a Power BI report with mobile layout in Power BI embedded analytics | Microsoft Learn
Thank you.
I'm using the latest version of the powerbi-client SDK. I noticed that this issue happens when the PBIR model is enabled, so it seems to be a PBIR limitation.
When I try to run JavaScript to validate whether the page has a Mobile Layout, the result is not returning true.
- v-saisrao-msft2 months ago
Community Support
Hi rafaelmpsantos,
Thanks for the update. Since you're already on the latest powerbi-client SDK, you can use page.hasLayout(models.LayoutType.MobilePortrait) to determine whether the page includes a Mobile Portrait layout. The documentation says this method returns a boolean that indicates whether the page has the specified layout. Microsoft also notes that if a page doesn't have a Mobile Portrait layout, it will be loaded with the MobileLandscape layout.
Embedding a Power BI report with mobile layout in Power BI embedded analytics | Microsoft Learn
Thank you.
- rafaelmpsantos2 months ago
Responsive Resident
The method page.hasLayout(models.LayoutType.MobilePortrait) does not works in PBIR reports. It's a bug.
- v-saisrao-msft2 months ago
Community Support
Hi rafaelmpsantos,
Thank you for the update. Since you've reproduced the behavior and believe this is a bug specific to PBIR reports, I'd recommend raising a Microsoft Support ticket.
Create a Fabric and Power BI Support Ticket - Power BI | Microsoft LearnThank you.