Forum Discussion

Abraxus's avatar
Abraxus
Advocate II
7 years ago
Solved

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

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.

  • Abraxus's avatar
    Abraxus
    7 years ago

    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!

8 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi Abraxus,

     

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

     

     

    Best Regards,

  • 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

  • Anonymous's avatar
    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.

      • Anonymous's avatar
        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.