Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
How we can create the custom theme for stacked bar graph using json file which include the conditional rule. i used the below code to achive the same but it's throwin error as error while importing the json file. Looks like conditional format is not supported here? it should be done manually?
"barChart": {
"*": {
"dataPoint": {
"fill": {
"solid": {
"color": {
"$expr": "d => {
if (d.value <= 20) return '#ED9AA1';
else if (d.value <= 40) return '#E77881';
else if (d.value <= 60) return '#E15662';
else if (d.value <= 80) return '#B4454E';
else return '#87343B';
}"
}
}
}
}
}
}
Solved! Go to Solution.
Hi @Aksha_poojari - In Power BI does not support conditional formatting directly in the JSON theme file, you can define colors in a JSON file and then apply the conditional formatting rules on the top of it using conditions manually through the Power BI interface.
create a measure calcuation and define the conditional formatting as per your requirement.
Hope the above information helps you.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Thanks for the solution
Hi @Aksha_poojari - In Power BI does not support conditional formatting directly in the JSON theme file, you can define colors in a JSON file and then apply the conditional formatting rules on the top of it using conditions manually through the Power BI interface.
create a measure calcuation and define the conditional formatting as per your requirement.
Hope the above information helps you.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.