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 the...
  • 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!