Forum Discussion
Anonymous
5 years agoNot applicable
Help with applying multiple specific colours in P.BI Themes using custom .json files
Hey everyone, If have the column Country and then in that clolumn I have France, Germany, England ect how would I do the following in a .json file? For column Country: France = yellow Engla...
- 5 years ago
My article here covers this. https://exceleratorbi.com.au/conditional-formatting-with-a-text-field-in-power-bi/
Anonymous
5 years agoNot applicable
Thank you for suggesting DAX for this over writing in a .json file. I used your idea to have a google and instead of using variables and an if statement I used the following with your method and it worked:
Colourformatting =
SWITCH(
TRUE(),
SELECTEDVALUE(Table[Country]) = "Germany" , "#ff0000",
SELECTEDVALUE(Table[Country]) = "France" , "#ffff99",
SELECTEDVALUE(Table[Country]) = "England", "#ffbf00",
"000000"
)
MattAllington
Community Champion
5 years agoGreat. For bonus points, you could create a master data table in Excel containing the country name and the HEX code you want to use. Then load that table and write your measure in such a way that it loads the values from your table. The benefit is that it is easier to maintain.