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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Abraxus
Advocate II
Advocate II

JSON theme incorporating format cards using 'selector' settings?

Hi All,

 

If possible, could you please explain how to account for the 'selector' (variable) field in Power BI JSON theme files? I've been looking into formatting the new Filters using the JSON theme file, and while I'm able to account for the 'Filter pane' formatting card in the JSON theme file (for reference, the 'Filter pane' is called "outspacePane" in the JSON file), the 'Filter cards' formatting card eludes me.

 

Specifically, this one:

 

'Filter cards' menu'Filter cards' menu

I can see/account for most of the fields within the JSON file easily enough (and the card itself is called "filterCard" in the JSON), but not sure how to account for the 'selector' which is the first (variable) field within the Power BI UI. In the screenshot shown, the 'selector' chosen is 'Available'.

Within the Power BI code, it's referenced as the 'id' of a 'selector' field, and appears as such:

\"selector\":{
        \"id\":\"Available\"

 

However, all of the practical variations on this don't seem to work. Any insight anyone can offer would be much appreciated, thanks. (The same also applies to button states etc.)

 

Regards,

Abraxus.

1 ACCEPTED SOLUTION

Hi All,

 

Firstly, very sorry for the lack of reply, my message was in limbo for the longest time and when it did go through I received no notifications, and since I haven't logged in since I wasn't aware it had shown up let alone was even getting replies!!! (And yes my account is set up to send email notifications, thanks Microsoft >_>)

 

Anyhow, since I posted this Microsoft have actually released the full code (which is rare) necessary (though I can't remember if I figured out the applied part myself or not?), Anyhow, below is an example of the section you need for the 'applied' etc. settings, hopefully this helps (colours are for demo purposes only): "

 

filterCard":[{ "$id":"Available", 
"backgroundColor":{ 
"solid":{ "color":"#555555" 
} }, 
"transparency":0, 
"border":false, 
"borderColor":{ 
"solid":{ 
"color":"#777777" 
} }, 
"foregroundColor":{ 
"solid":{ 
"color":"#000000" 
} }, 
"textSize":13, 
"fontFamily": "Arial", 
"inputBoxColor":{ 
"solid":{ 
"color":"#111111" 
} } }, 
{ "$id":"Applied", 
"backgroundColor":{ 
"solid":{ 
"color":"#ffffff"
 } },
"transparency":0, 
"border":false, 
"borderColor":{ 
"solid":{ 
"color":"#b1b3b6" 
} }, 
"foregroundColor":{ 
"solid":{ 
"color":"#000000" 
} }, 
"textSize":14, 
"fontFamily": "Arial", 
"inputBoxColor":{ 
"solid":{ 
"color":"#333333" 
} } }]

P.S. Colours are obviously to be replaced, also apologies for the horrible formatting, my code is usually much neater than that!

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Did you ever find an answer to this?

 

I would love to be able to set in my theme the default color of any applied filter.

This code was all provided in the Power BI Desktop May 2019 Feature Summary blog post. Everything that I've tried works great except for the background color for the Applied cards. If you figure that out let me know. Smiley Happy

Anonymous
Not applicable

Thanks Scott, I will give that a try at some point today. It's the applied cards that I'm after so here's hoping it works.

Good luck. I've tried it, but I can't get the background color on Applied to change. If you figure that out please let me know.

Sorry forgot to reply directly, please see post above if you're still trying to figure this out like I was, thanks!

Hi All,

 

Firstly, very sorry for the lack of reply, my message was in limbo for the longest time and when it did go through I received no notifications, and since I haven't logged in since I wasn't aware it had shown up let alone was even getting replies!!! (And yes my account is set up to send email notifications, thanks Microsoft >_>)

 

Anyhow, since I posted this Microsoft have actually released the full code (which is rare) necessary (though I can't remember if I figured out the applied part myself or not?), Anyhow, below is an example of the section you need for the 'applied' etc. settings, hopefully this helps (colours are for demo purposes only): "

 

filterCard":[{ "$id":"Available", 
"backgroundColor":{ 
"solid":{ "color":"#555555" 
} }, 
"transparency":0, 
"border":false, 
"borderColor":{ 
"solid":{ 
"color":"#777777" 
} }, 
"foregroundColor":{ 
"solid":{ 
"color":"#000000" 
} }, 
"textSize":13, 
"fontFamily": "Arial", 
"inputBoxColor":{ 
"solid":{ 
"color":"#111111" 
} } }, 
{ "$id":"Applied", 
"backgroundColor":{ 
"solid":{ 
"color":"#ffffff"
 } },
"transparency":0, 
"border":false, 
"borderColor":{ 
"solid":{ 
"color":"#b1b3b6" 
} }, 
"foregroundColor":{ 
"solid":{ 
"color":"#000000" 
} }, 
"textSize":14, 
"fontFamily": "Arial", 
"inputBoxColor":{ 
"solid":{ 
"color":"#333333" 
} } }]

P.S. Colours are obviously to be replaced, also apologies for the horrible formatting, my code is usually much neater than that!

Scott_BI
Frequent Visitor

Abraxus,

 

Would you be willing to share the json you have created? I've been having difficulty finding the json formatting options for the pane.

 

Thank you!

Scott

v-jiascu-msft
Employee
Employee

Hi Abraxus,

 

Do you mean the report themes here? I didn't find anything there. Can you give more details, please?

 

 

Best Regards,

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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