Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
apenaranda
Post Partisan
Post Partisan

view mobile version app flask embedded

Hello,
I have an app made in Flask where I embed the power bi reports. These reports are in desktop view design and I would like to make a report in mobile view. The ideal would be to make the report in mobile and desktop view and it will detect where you are viewing it and thus show you the corresponding one.
What I don't know is to first embed the mobile view.

Would anyone know how to do it within a Flask app?

thank you.

3 REPLIES 3
apenaranda
Post Partisan
Post Partisan

Has anyone managed to embed a Powerbi report (previously created the mobile design view and uploaded to the Power Bi work area) in an external Powerbi application (example in python) and have the mobile design displayed? I can't believe that there is only the mobile view from the official Powerbi application.

apenaranda
Post Partisan
Post Partisan

I will review what you say.
In reference to the javascript code, I have already tested it on localhost from my PC, adding this part to the code but it doesn't do anything, I don't know if it detects desktop so it no longer shows the mobile layout, is that right?...
On the other hand, if the mobile design is for the power bi app, how should I do it if I have my own app in python? Basically what I want is to show the mobile or desktop design depending on which device I connect from.

 

var embedConfiguration = {
    type: 'report',
    id: reportId,
    embedUrl: embedUrl,
    tokenType: tokenType,
    accessToken: accessToken,
    settings: {
        layoutType: models.LayoutType.MobilePortrait
    }
};
Anonymous
Not applicable

HI @apenaranda,

You can take a look at the following link about the similar requirement:

powerbi - Embed power bi dashboard into Flask Application - Stack Overflow

It is possible dynamic switch between report layout and mobile layout. You can add JavaScript function to verify the requests(e.g. UA) to get device type, then you can dynamic switch the embed configurations layout part.

Embedding a Power BI report with mobile layout in Power BI embedded analytics | Microsoft Learn

BTW, current the mobile layout are worked for power bi mobile app, it not suitable when directly access from mobile device.

About mobile-optimized Power BI reports - Power BI | Microsoft Learn

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.