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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Arsash_Bizaval
Frequent Visitor

background color of the Visual Slicer Value

Hi

In the JSON file, how do I change both the Visual Slicer background and the background color of the Visual Slicer Value?

Assuming I would like the first blue and the second to choose red.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from divyed  and DataNinja777 , please allow me to provide another insight:

Hi, @Arsash_Bizaval 
Thanks for reaching out to the Microsoft fabric community forum.

Regarding the issue you raised, my solution is as follows:

I suggest you replace the slicer section of your JSON file with the following:

"slicer": {
    "*": {
        "items": [
            {
                "fontColor": { "solid": { "color": "#FFFFFF" } },
                "background": { "solid": { "color": "#E4080A" } }
            }
        ],
        "background": [
            {
                "transparency": 100
            }
        ]
    }
}

Below are the results after I modified your JSON file:

vlinyulumsft_0-1738749086750.png

You can refer to the following link for official guidance:

vlinyulumsft_1-1738749086752.png

 

PowerBI-ThemeTemplates/Slicer.json at master · MattRudy/PowerBI-ThemeTemplates · GitHub

You may need to note that in my settings, I changed the font colour to white to contrast with the red font background. Additionally, if the slicer is in slider mode, the red font background may be in the JSON. 

vlinyulumsft_2-1738749096959.png

Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
 

Best Regards,

Leroy Lu

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

View solution in original post

4 REPLIES 4
divyed
Super User
Super User

Hello @Arsash_Bizaval ,

 

Please use below code :

{
"visualStyles": {
"*": {
"*": {
"background": [
{
"color": "#0000FF", // Blue for slicer background
"value": "Background"
}
],
"slicer": [
{
"color": "#FF0000", // Red for slicer value background
"value": "Slicer Values"
}
]
}
}
}
}

 

How to Apply :

1. Copy this JSON and modify it as per your need.

2. Use this in the Power BI Theme JSON file.

3. Load the updated theme in Power BI to apply the color changes to your slicer visual.

 

I hope this helps.

 

Did I answer your question ? Mark this as solution if this helps so that other members can find this quickly.

 

Regards,

Neeraj Kumar

 

 

 

LinkedIn : https://www.linkedin.com/in/neeraj-kumar-62246b26/
DataNinja777
Super User
Super User

Hi @Arsash_Bizaval ,

 

To change both the Visual Slicer background and the background color of the Visual Slicer Values in Power BI using a JSON theme, you need to define these properties under the visualStyles section in your JSON file.

For the slicer background, set the background color property at the slicer level. To ensure the slicer background appears blue, use "#0000FF". For the slicer values background, modify the values property and set its background to a solid fill with the color red ("#FF0000").

{
    "visualStyles": {
        "slicer": {
            "*": {
                "background": [
                    {
                        "color": "#0000FF"
                    }
                ],
                "values": [
                    {
                        "background": {
                            "solid": {
                                "color": "#FF0000"
                            }
                        }
                    }
                ]
            }
        }
    }
}

To apply this theme in Power BI, save the JSON content as a .json file, then go to the View tab in Power BI, click Themes, and select Browse for Themes to upload your file. This will update the slicer visuals accordingly, applying a blue background to the entire slicer and a red background to the slicer values.

 

Best regards,

I applied these codes but I got an error while making changes in Power BI. Could you please check my file?
Thanks

 

myTheme 

Anonymous
Not applicable

Thanks for the reply from divyed  and DataNinja777 , please allow me to provide another insight:

Hi, @Arsash_Bizaval 
Thanks for reaching out to the Microsoft fabric community forum.

Regarding the issue you raised, my solution is as follows:

I suggest you replace the slicer section of your JSON file with the following:

"slicer": {
    "*": {
        "items": [
            {
                "fontColor": { "solid": { "color": "#FFFFFF" } },
                "background": { "solid": { "color": "#E4080A" } }
            }
        ],
        "background": [
            {
                "transparency": 100
            }
        ]
    }
}

Below are the results after I modified your JSON file:

vlinyulumsft_0-1738749086750.png

You can refer to the following link for official guidance:

vlinyulumsft_1-1738749086752.png

 

PowerBI-ThemeTemplates/Slicer.json at master · MattRudy/PowerBI-ThemeTemplates · GitHub

You may need to note that in my settings, I changed the font colour to white to contrast with the red font background. Additionally, if the slicer is in slider mode, the red font background may be in the JSON. 

vlinyulumsft_2-1738749096959.png

Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
 

Best Regards,

Leroy Lu

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors