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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi everyone!
For my visualizations, I'm comparing the same KPI with a difference:
- The KPI only based on last performace.
- The KPI based on all performances excepted the last one.
As you can see in the image, I show both KPI measures with a dimension in Y-axis but I would like to change the green colour (the colour of the KPI - Last Performance) for a conditional colour based in:
- If KPI Last Performance > KPI Average, bar colour = red. (Worse performance than avg)
- If KPI Last Performance < KPI Average, bar colour = green. (Better performance than avg)
Could you tell me, please, if this is possible in Power BI?
Thanks in advance.
Solved! Go to Solution.
Hi , @sfernamer
Thanks for your quick response!
I test it in my side , When we put the two fields on the value , we can not set the conditional format color for it, this feature only be used in one field. If we want to custom the color , we can only add a dimension in it , like this:
Type2<5 = var _type2 = CALCULATE( SUM('Table'[Value]) , 'Table'[Type]= "Type2")
return
IF(_type2<=5,_type2,BLANK())
Type2>5 = var _type2 = CALCULATE( SUM('Table'[Value]) , 'Table'[Type]= "Type2")
return
IF(_type2>5,_type2,BLANK())
Then we can configure the color in this:
And the result will be:
For your need , i can not find the conditional format the color for the multy-fields on the bar chart . You can post your idea to Power Ideas to make this product more and more perfect.
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @sfernamer
According to my testing and research, conditional formatting is actually suitable for bar charts to some extent, for example, you can see my example, I defined a measure here to manually output the name of the color I want to output for your bar chart according to the rules:
Color =
SWITCH(
TRUE(),
SELECTEDVALUE('Table'[Column2])>=2,"Green",
SELECTEDVALUE('Table'[Column2])<2,"Red",
"White")
Then I applied this corresponding measure to the conditional formatting of the bar chart, like this
Then you can achieve your needs, you can first try to click this button to see if the direct UI interface settings can achieve your needs, and then decide according to your situation whether to manually write the measurement value output color name logic according to my method above.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you @v-yueyunzh-msft for your time and your reply.
For what I see, your example is based on a bar chart representing one measure. What I'm looking for is to use the conditional formatting for one measure when representing two, like my first graph. Idk if it's possible in Power BI.
Thank you for your time.
Hi , @sfernamer
Thanks for your quick response!
I test it in my side , When we put the two fields on the value , we can not set the conditional format color for it, this feature only be used in one field. If we want to custom the color , we can only add a dimension in it , like this:
Type2<5 = var _type2 = CALCULATE( SUM('Table'[Value]) , 'Table'[Type]= "Type2")
return
IF(_type2<=5,_type2,BLANK())
Type2>5 = var _type2 = CALCULATE( SUM('Table'[Value]) , 'Table'[Type]= "Type2")
return
IF(_type2>5,_type2,BLANK())
Then we can configure the color in this:
And the result will be:
For your need , i can not find the conditional format the color for the multy-fields on the bar chart . You can post your idea to Power Ideas to make this product more and more perfect.
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @FreemanZ
Firstly, thanks for your reply. I tried conditional formatting but it's not working with bar graph. It's true that I can use it the conditional format in table (image 1) so the conditional format measure works but I have no chance to add the measure created to define the colour of the bar graph.
Could you tell me, please, if it's possible to use it with bar graphs or other more visual graphs than a table? Thank you in advance.
hi @sfernamer
yes, with conditional formating. You can write measures to dynamically apply that. like this: