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
DavidAnthony
Helper I
Helper I

How to set default Padding = 0 and turn off Background in Visual Format (Power BI)?

Hi everyone,

I'm currently developing a custom visual for Power BI, and I want to configure the default settings for the visual when it's added to a report.

Specifically, I want to:

Set the default Padding (under format > general > padding) to 0 px on all sides.

Set the default Background (under format > effects > background) to Off by default.

I’m looking for a way to override the default format panel values when the visual is first inserted.

Is there a way to control these defaults in a custom visual?

Any guidance or example on how to set these initial values (via capabilities.json, visual.ts, or other metadata) would be greatly appreciated.

I've attached screenshots of the settings I'm trying to control.

Thanks in advance!

DavidAnthony_0-1751942307821.pngDavidAnthony_1-1751942314798.png

 



4 REPLIES 4
dm-p
Super User
Super User

Hi @DavidAnthony,

 

The main window owns the common visual container properties (everything in the 'General' menu) and cannot be accessed by the visual (either reading or writing). Custom visuals only have access to two properties under the general object: filter and formatString (which have specific use cases).

 

The only way to override these is to create a report JSON theme with the appropriate defaults.

 

If you want these available to custom visuals, I suggest making a feature request.

 

Regards,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




v-tejrama
Community Support
Community Support

Hi @DavidAnthony  ,
Thanks for reaching out to the Microsoft Fabric Community forum.

It seems you are trying to build a custom Power BI visual and wants to control the default formatting settings that appear in the visual’s format pane when it's first inserted into a report. Specifically, you are trying to set all padding values to 0 px and turn off the background by default.

You are looking for a way to define these initial format defaults either through capabilities.json, visual.ts, or other config which is the right way, so the visual loads with their preferred formatting without the user needing to change it manually.

 

In order to achieve this you can go through the below documents:
About format pane and formatting model in Power BI custom visuals - Power BI | Microsoft Learn

Capabilities and properties of Power BI visuals - Power BI | Microsoft Learn

Add formatting options to a Power BI custom visual - Power BI | Microsoft Learn

Customize the format pane in Power BI custom visuals - Power BI | Microsoft Learn

 

Thank you.

 

Hi  @DavidAnthony ,

 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

 

Thank you.

 

Hi @DavidAnthony ,

 

I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.

 

Thank you.

 

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 community update carousel

Fabric Community Update - June 2025

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