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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
markces
Regular Visitor

Remove margins in an embedded Power BI report using iFrame on a Project Online sharepoint site

My aim is to allow Project Online users to view a Power BI report from a link in the PO menu without having to open Power BI. I want them to remain within the PO sharepoint site at all times. All users have a Power BI licence but currently only access other Power BI reports via their Teams site.

 

I have used the Power BI Embed report > Website or portal option to copy the html iFrame code below. A web page was created in PO and the html was pasted into a Script Editor web part.

 

markces_1-1614030255564.png

This all worked fine, except when I view the report the font is much smaller and there are large shaded vertical margins, as you can see in the sample below. Is there any way of using html code to remove the margins and resize the report so that it takes up the whole frame?

 

markces_0-1614030010004.png

 

2 ACCEPTED SOLUTIONS

BTW Lionel,

I removed the space - marginwidth="0" and also tried marginwidth="0px".

Thx Mark.

 

View solution in original post

Thanks Lionel,

have managed to change the height and width settings in the embeded code to reduce the size of the margins. Took a few tries to get the correct size image on the screen to reduce scrolling but now have a workable page. Appreciate your help.

Regards, Mark.

View solution in original post

5 REPLIES 5
v-lionel-msft
Community Support
Community Support

Hi @markces ,

 

Use the element selector of the browser to analyze the HTML5 and CSS3 codes of the current page. It may be that a certain tag has fixed the left and right margins.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Lionel,

have managed to change the height and width settings in the embeded code to reduce the size of the margins. Took a few tries to get the correct size image on the screen to reduce scrolling but now have a workable page. Appreciate your help.

Regards, Mark.

v-lionel-msft
Community Support
Community Support

Hi @markces ,

 

Try to add the "marginwidth" parameter in "iframe" label.

v-lionel-msft_0-1614156438750.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the suggestion Lionel.
I have tried adding marginwidth parameter, see code below, but there is no change to the page - margins are still there.

<iframe width="1140" height="541.25" marginwidth= "0" src="https://app.powerbi.com/reportEmbed?repor...

BTW Lionel,

I removed the space - marginwidth="0" and also tried marginwidth="0px".

Thx Mark.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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