Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
England = blue
ect
I know there is a custom colour theme creator available so my aim was to use that and then implement this into that.
EDIT: Reason being I have 100+ brands and each has their own colour I want to apply this to the theme file so all of my graphs use this colour coding system. I don't fancy applying all of this to each page individually.
Any suggestions will be most helpful.
Thanks!
Solved! Go to Solution.
My article here covers this. https://exceleratorbi.com.au/conditional-formatting-with-a-text-field-in-power-bi/
You cannot set the sort order to align to your data in a theme file. You could try determining the sort order of your data, and then ordering the colour in your theme file in the same order. You may get lucky
My article here covers this. https://exceleratorbi.com.au/conditional-formatting-with-a-text-field-in-power-bi/
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:
Great. 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.
Hi Matt, thank you for your response but I am referring to applying a custom theme by importing a .json file so this would not be written in DAX. Reason being I have 100+ brands and each has their own colour I want to apply this to the theme file so all of my graphs use this colour coding system.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
88 | |
49 | |
45 | |
38 | |
37 |