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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.