Data Science via VS Code. Part 1: install, extensions, virtual env.
Welcome to the mini-blog series on data science in Visual Studio (VS) Code!
9 min read
Sam Binnie : Jan 13, 2025 1:02:57 PM
Ever spent too much time chasing down the effects of theme changes across multiple visuals in your Power BI reports?
It’s easy to get caught up perfecting one visual, only to have another unexpectedly shift, leaving you wondering which setting caused the change. Whether it’s fonts, colours, or data labels, the cascading effects of theme settings can be tough to track.
To make your life easier, we've created a comprehensive guide that breaks down exactly which settings in Power BI Desktop’s theme impact which elements of different visuals. Plus, we’ve included a visual matrix that gives you a quick overview of which visual types are affected by each setting—so you can spend less time guessing and more time creating beautiful, consistent reports.
Setting up and using a theme in Power BI is a great way to ensure consistency and professionalism in your reports and dashboards. By applying a pre-defined colour scheme, font style, and layout, you align your visualisations with your company's brand guidelines, reinforcing the organisation’s identity and ensuring that reports are easily recognisable. This also enhances user experience by creating a unified look across all reports, making them easier to read and interpret. Additionally, using a theme saves time by reducing the need to manually adjust design elements in each report, allowing for greater efficiency and consistency in presentation.
The following outlines some of the main visuals in Power BI identifying the Power BI Desktop theme settings that determine their formatting.
This provides an overview of which theme formatting sections will update across different visual types. It allows you to quickly see which visuals will be affected when you modify a particular setting.
Formatting found in the General Tab in the Visual Pane are mostly the same across all visuals. Below is formatting that is consistent across the majority of visuals.
Zoom sliders on Graphs and Charts can not be set here. It defaults to dark grey / black
Setting |
Formats: |
---|---|
Names and Colours > Names and Colours > Colour 1 |
Glow Colour |
Names and Colours > Advanced > First Level Elements |
Shadow Colour |
|
|
Names and Colours > Advanced > Second Level Elements |
Subtitle Colour Divider Colour |
Text > Title |
Title Font Family, Size, and Colour |
Visuals > Header |
Background Fill Colour Border Colour Icon Colour |
Header Icons appear at the top right of a visual when selecting it. These are generally turned off for the user.
|
|
Visuals > Background |
Visual Background Fill Colour |
Visuals > Border |
Visual Border Colour Visual Border Rounded Corners Some visuals have a secondary border, such as Table, Matrix, New Card, Shapes, and Buttons. These borders are outlined in the relevant sections. |
Setting |
Formats Page: |
---|---|
Page > Page Background |
Background Fill Colour and Transparency |
Text Font Family and Size can not be set here. It defaults to Segoe UI, size 10.
Shadow for Shapes can not be set here. It defaults to Black.
This is the shadow for just the shape, not the full box of the visual.
Setting |
Formats Shape: |
---|---|
Name and Colours > Name and Colours > Colour 1 |
Fill colour Border colour |
Name and Colours > Advanced > Background Elements |
Text Colour |
Setting |
Formats Button: |
---|---|
Name and Colours > Advanced > Second Level Elements |
Text Colour Icon Line Colour Border Colour |
Name and Colours > Advanced > Third Level Elements |
Disabled Fill Colour Disabled Border Colour |
Name and Colours > Advanced > Fourth Level Elements |
Disabled Text Colour Disabled Icon Line Colour |
Name and Colours > Advanced > Background Elements |
Fill Colour |
Name and Colours > Advanced > Secondary Background Elements |
Disabled Fill Colour Disabled Border Colour |
Text > General |
Font Family and Size (not Colour) |
Setting |
Formats Navigation Button: |
---|---|
Name and Colours > Advanced > First Level Elements |
Selected Button Fill Colour Non Selected Button Text Colour Non Selected Button Hover Text Colour Border Colour Accent Bar Colour |
Name and Colours > Advanced > Third Level Elements |
Non Selected Button On Hover Fill Colour |
Name and Colours > Advanced > Background Elements |
Non Selected Button Fill Colour Selected Button Text Colour |
|
|
Name and Colours > Advanced > Secondary Background Elements |
Non Selected Button On Press Fill Colour |
Text > General |
Values Font Family and Size (not Colour) |
Checkbox, Expand Icons, and Scroll Bar can not be set here. The default is Grey.
Setting |
Formats Slicer: |
---|---|
Text > General |
Values Font Family and Size (not Colour) |
Names and Colours > Advanced > First level elements |
Values Text Colour On Hover Text Colour |
Name and Colours > Advanced > Second Level Elements |
Title and Individual Values Border Colour Icon Colour Selected Item Text Colour (when set as drop down list) |
Setting |
Formats Tile Slicer: |
---|---|
Text > General |
Secondary Value Font Family and Size (not Colour) |
Text > Title |
Value Font Family and Size (not Colour) |
Names and Colours > Advanced > First level elements |
Non Selected Tiles Text Colour Selected Tiles Fill Colour Accent Bar Colour Selected Tiles Border Colour |
Name and Colours > Advanced > Second Level Elements |
Second Value Text Colour |
Name and Colours > Advanced > Third Level Elements |
On Hover Fill Colour |
Name and Colours > Advanced > Fourth Level Elements |
‘Select All’ Tile Fill Colour (when another tile is selected) Non Selected Tiles Border Colour |
Name and Colours > Advanced > Background Elements |
Non Selected Tiles Fill Colour Text Colour on selected tile |
Name and Colours > Advanced > Secondary Background Elements |
On Press Fill Colour |
Setting |
Formats Text Slicer: |
---|---|
Text > General |
Search Box Font Family and Size (not Colour) |
Names and Colours > Advanced > First level elements |
Search Box Text Colour |
Name and Colours > Advanced > Second Level Elements |
Icon Colour Accent Bar Colour |
Name and Colours > Advanced > Third Level Elements |
Applied Text Background Fill Colour Apply Icon Background Fill Colour |
Name and Colours > Advanced > Background Elements |
Search Box Background Fill Colour |
Name and Colours > Advanced > Secondary Background Elements |
Applied Text Border Colour Apply Icon Border Colour Search Box Border Colour |
Setting |
Formats List Slicer: |
---|---|
Names and Colours > Advanced > First level elements |
Text Values Colour Selection Box Colour Selected Box Fill Colour Selections Expand Icon Accent Bar |
Name and Colours > Advanced > Third Level Elements |
On Hover Fill Colour |
Name and Colours > Advanced > Fourth Level Elements |
Values Border Colour |
Name and Colours > Advanced > Background Elements |
Values Background Fill Colour |
Setting |
Formats Text Box: |
---|---|
Text > General |
Search Box Font Family, Size, and Colour |
Setting |
Formats Card: |
---|---|
Name and Col ours > Advanced > Second Level Elements |
Card Category Text Colour |
Text > Cards & KPIs |
Callout Value Font Family, Size, and Colour |
Text > General |
Category Font Family (not Colour) |
Setting |
Formats Multi Row Card: |
---|---|
Name and Colours > General > Colour 1 |
First Field Text Colour (Cards Title) |
Name and Colours > Advanced > Second Level Elements |
Category Label Text Colour |
Name and Colours > Advanced > Fourth Level Elements |
Multi Card Accent Bar Colour |
Text > General |
Category Values Font Family, Size, and Colour (Callout Values) Category Label Font Family (not Colour) |
Text > Title |
First Field Font Family (not Size or Colour) |
Setting |
Formats New Card: |
---|---|
Name and Colours > Advanced > First Level Elements |
Full border colour Gridline colour for each card grouping Category Values Colour Accent Bar colour |
Name and Colours > Advanced > Second Level Elements |
Category Labels Text Colour |
Name and Colours > Advanced > Fourth Level Elements |
Category Box Border Colour |
Name and Colours > Advanced > Background Elements |
Category Box Fill Colour (Layout) Both Boxes Fill Colour (Small Multiples Layout) Title Box Fill Colour (Small Multiples Header) |
Text > General |
Category Label Text Font Family and Size (not Colour) |
Text > Tab Headers |
Title Section Box Font Family, Size, and Colour |
Text > Cards & KPIs |
Category Values Font Family and Size (not Colour) |
Additional Borders and Gridlines Info Black - Border
|
For Line and Column Combo Charts, the line colour can not be set here. It defaults to a Dark Blue.
Setting |
Formats Chart: |
---|---|
Name and Colours > Name and Colours > Theme Colours |
Value Colours 1-8 |
Name and Colours > Advanced > Second Level Elements |
Legend Text Colour Axis Label Values Text Colour Data Labels Text Colour Vertical Line on Hover Colour (Line and Area Charts only) Bar / Column Border Colour (Bar / Column / Ribbon Charts) |
Name and Colours > Advanced > Secondary Background |
Axis Gridline Colour Ribbon Fill Colour (When Match Series is Off) (Ribbon Charts only) |
Text > General |
Legend Font Family and Size (not Colour) Axis Label Values Font Family and Size (not Colour) Data Label Font size is auto set to slightly smaller than the size set here. |
Text > Title |
Axis Title Font Family, Size, and Colour |
Setting |
Formats Pie / Donut: |
---|---|
Name and Colours > Name and Colours > Theme Colours |
Value Colours 1-8 |
Names and Colours > Advanced > Second Level Elements |
Legend Title Text Colour Legend Values Text Colour Segment Call Out Labels Text Colour (Details) |
Names and Colours > Advanced > Background Elements |
Divider Lines Between each Segment |
Text > General |
Legend Title Font Family and Size (not Colour) Legend Values Font Family and Size (not Colour) Segment Call Out Labels Font Family (Details) (not Colour) |
Values and Headers Text Colour is set by First Level Elements (excluding totals section)
Font Family and Size is set in Text
Totals Text Colour is set in Text - note below
Totals section text colour difference between Table and Matrix
Table - The colour for both the word ‘Total’ and the values are set in Text.
Matrix - The colour of the word ‘Total’ is set by First Level Elements, the total values colour is set in Text.
Setting |
Formats Table / Matrix: |
---|---|
Name and Colours > Advanced > First Level Elements |
Values Text Colour Values Alternate Text Colour Column Header Text Colour Row Header Text Colour (Matrix only) |
Name and Colours > Advanced > Background Elements |
Values Background Fill Colour Column Header Background Fill Colour Row Header Background Fill Colour |
Text > General |
Values Font and Size (not Colour) Column Headers Values Font and Size (not Colour) Row Headers Values Font and Size (not Colour) Column Subtotals Font, Size, and Colour Row Subtotals Font, Size, and Colour Column Grand totals Font, Size, and Colour Row Grand totals Font, Size, and Colour Visual Border Shadow Colour |
First Level Elements / Background Elements The two below automatically set as a mix between the lighter colour of First Level Elements Values Alternate Background Colour Gridlines |
|
Additional Info Grid Border can not be set here. It defaults to a light blue. In the below image, the orange is the gridlines while the teal is the grid border. |
Setting |
Formats Q&A: |
---|---|
Names and Colours > Names and Colours > Colour 1 |
Question Suggestion Background Fill Colour Submit Arrow Background Fill Colour |
Names and Colours > Advanced > Background Elements |
Search Area Background Fill Colour |
Names and Colours > Advanced > Secondary Background Elements |
Search Area Auto Suggestions on Hover Background Fill Colour |
Text > General |
All Text Font Family and Size Question Text Entry Colour ‘Try one of these to get started’ Colour Icon Colour |
Setting |
Formats Tooltip: |
---|---|
Visuals > Tooltip > Label Text Colour |
Title Text Colour (Left side of Tooltip) |
Visuals > Tooltip > Value Text Colour |
Values Text Colour (Right side of Tooltip) |
Visuals > Tooltip > Drill Text and Icon |
Drill through Options Text Colour |
Visuals > Tooltip > Background Colour |
Tooltip Background Fill Colour |
Names and Colours > Advanced > Secondary Background Elements |
Drill Through Divider Line Colour Drill Through Options on Hover Colour |
Once you've configured your Power BI theme to match your desired look and feel, it's important to save it so you can easily apply it to future reports. By saving your theme, you ensure consistency across all your projects and can quickly access it whenever needed.
View > Themes > Save current theme
Save as a JSON file in a location easily accessible by relevant people
View > Themes > Browse for themes
Navigate to JSON file and select it. Power BI will import it into the report and update all visuals.
After setting up the base theme in Power BI Desktop, you can further customise the appearance of your reports by modifying that theme’s JSON file. If there are certain visuals or components you want to have different default formatting, you can configure this in the JSON file.
The JSON file allows you to
configure aspects that cannot be adjusted directly through the Power BI Desktop theme options
configure some visuals or components to have a different default formatting
Formatting configured in the JSON file will override any settings in Power BI desktop.
For instance, you can fine-tune individual visual components, set specific colours for chart elements, or adjust properties like axis styles or title fonts that go beyond the basic settings available in the interface. You can also add extra settings, such as controlling decimal places or defining the min/max values for graph axes.
The JSON file is especially useful when you want to apply a consistent style across most visuals but make exceptions for specific visual types. Even if these changes seem quick to apply manually in a single report, it's beneficial to define them in the JSON file. Doing so ensures that the customisations are reusable in future reports, which is especially helpful when collaborating with others or when new reports need to follow the same visual guidelines. By modifying the JSON file, you eliminate the need for documentation on manual adjustments, making your reporting process more efficient and consistent across your organisation.
Open the JSON file in a tool like Visual Studio.
In Visual Studio it will often originally open with no line formatting. Shift + Alt + F will set the line formatting.
It will only display the components that were modified in the Power BI Desktop theme, highlighting the differences from the default settings of the original inbuilt theme.
Information on how to configure settings in JSON can be found across many online sources. Some places to start are:
Online Video Tutorials
If you configure a setting in the Desktop theme which doesn’t appear to work, there are two likely reasons. First check if it has been manually set in the Visualizations pane. In Power Bi desktop, go to the relevant section and click 'Reset to Default.'
Alternatively that setting may be configure in the JSON file. Open the JSON file and find the relevant visual.
Mastering the use of Power BI themes is a game-changer when it comes to creating visually consistent and professional reports. By understanding how different theme settings affect various visuals, you can save valuable time and avoid the frustrations of unexpected formatting changes. With the help of this guide, you’ll be able to streamline your design process, ensuring that every report aligns with your brand identity while maintaining clarity and ease of use for your audience. Now, you can focus more on the insights your data provides, with less worry about formatting.
Welcome to the mini-blog series on data science in Visual Studio (VS) Code!
Have you ever had a spreadsheet which tracks something in your work, and you are finding it harder to manage or you want more features than are...
If this is the first post you have opened, I recommend you jump back to the Part 1. Install VS Code, relevant extensions and create a virtual...