Visual padding was a long awaited feature in Power BI and Microsoft added support for it in 2023-March release of Power BI. In the past, users had to use dirty workarounds to create padding and this new feature is a great addition to Power BI.As of May 2023 release, the padding feature has some limitations:Padding adjustments are per side; no shortcut to adjust top, bottom, left and right at one goNo way to define a default padding at report levelTo overcome this issue, we can control the Power BI visual padding using themes. We will use a simple theme that only adjust the padding for demonstration. Please save the below snippet as a json file so that we can use it as a theme.{ "name": "Padding Demo", "visualStyles": { "*": { "*": { "padding":[{ "top":20, "bottom":20, "left": 20, "right":20 }] } } } } To use our new theme, go to View > Browse for themes and select the the json file created in previous step. Below screen grab shows the procedure and the end results.
Thanks Jose, turns out this is not one of the supported styles in https://themegenerator.point-gmbh.com/ so this little blog post was useful for me!I did apply the style you suggested (but with 10) and then I had to go over to the individual styles for: Buttons, Slicers, Card, Cardvisual and shape, to add the style with 0, as those objects do not like nice enough IMO with the padding.Have a good one, and thanks againReply
Hi Jose, Great post, that gave me exactly what I needed. For those not so experienced it could be a great help with an example that showed how to implement your code in an existent theme, or how to add the code to a specific visual, if you wanted to do that. I can see from your blog, that your main focus is not on PowerBI, so I am just happy, that you gave me exactly what I wanted.Reply