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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Mark84
Regular Visitor

Define the slicer background-color in custom theme

Hi everybody,

is it possible to define the background-color of the slicer with the json-file?

Thanks,
Mark

1 ACCEPTED SOLUTION
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@Mark84,

Based on my test, there is no specific  option to set background color for slicer in JSON file. However, after you import report theme JSON file to the PBIX file, you can apply colors of the report theme to the slicer background manually.
1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

12 REPLIES 12
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@Mark84,

Based on my test, there is no specific  option to set background color for slicer in JSON file. However, after you import report theme JSON file to the PBIX file, you can apply colors of the report theme to the slicer background manually.
1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This works for me with the July 2018 release of Power BI Desktop.

 

    "slicer": {
      "*": {
        "background": [{
            "show": true,
            "color": {
              "solid": {
                "color": "#123456"
              }
            },
            "transparency": 0
          }
        ]
      }
    },

Hi, since you guys are talking about slicers, does anyone know the code to make a Combobox/Dropdown default instead of the List?

Would love to know how to do this... searched all over and can't find a thing mentioning it. 

This is the best reference I've seen as far as a near-complete .json definition for slicers.  It is in a github repository has very good definitions for most Power BI visuals.

 

 

Works all well the only thing I couldn't figure out is how to set "Date inputs" attributes?

I'm also looking to change color of Date Inputs and Slider of the Slicer visual.

Here you will find all the answers. This repository has helped me to figure out everything.

Thanks @zapppsr , @gaccardo already mentioned it above, and it is a great resource; however there are no mentions of changing "date input" properties of a slicer.

@datamodel Here is an example of how you format date inputs:

 

        "date": [
          {
            "background": {
              "solid": {
                "color": "#FFFFFF"
              }
            },
            "fontFamily": "'Segoe UI Bold', wf_segoe-ui_bold, helvetica, arial, sans-serif",
            "fontColor": {
              "solid": {
                "color": "#223645"
              }
            }
          }
        ]

 

"date" works just like "items" .

BTW, I guessed "date" and it worked. It's not documented anywhere.

There is also another undocumented option: "foregroundNeutralSecondary". 

foregroundNeutralSecondary.PNG 

That's a great one, and the one I've used so far to get almost everything i need. Just can't figure out how to switch from list to drop-down. 

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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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