Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Changing the color of bars with conditional formatting

Good day community,

I had applied a conditional formatting to a bar chart so that it changed if it was A or AA then the color green was placed, if B or BB changed to yellow... With the installation of the latest version it doesn't let me do this conditional formatting with text-like values

WilliamForero_0-1699465284999.png

Is there a way to put a conditional formatting back in for text

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi WilliamForero,


Please create a new measure like:

 

Measure = 
VAR _cur_col_name = SELECTEDVALUE('Table'[Column1])
RETURN
SWITCH(
    TRUE(),
    _cur_col_name IN {"A","AA"},"Green",
    _cur_col_name IN {"B","BB"},"Yellow",
    _cur_col_name IN {"C","CC"},"Orange"
)

 

and apply it by field value:

vcgaomsft_0-1700708637514.png

 

vcgaomsft_1-1700708637672.png

Please check the pbix file.

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

9 REPLIES 9
Syndicate_Admin
Administrator
Administrator

Hi @WilliamForero ,

Please create a new measure like:

Measure = 
VAR _cur_col_name = SELECTEDVALUE('Table'[Column1])
RETURN
SWITCH(
    TRUE(),
    _cur_col_name IN {"A","AA"},"Green",
    _cur_col_name IN {"B","BB"},"Yellow",
    _cur_col_name IN {"C","CC"},"Orange"
)

and apply it by field value:

vcgaomsft_0-1700703658124.png

vcgaomsft_1-1700703737229.png

Please check the pbix file.

Best Regards,
Gao

Community Support Team

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data in the Power BI Forum

Syndicate_Admin
Administrator
Administrator

This is what you tell me is what I need, however, when I try to choose the column of the table that I need to define the criteria, it is not selected.

WilliamForero_0-1700665326155.png

Anonymous
Not applicable

Hi WilliamForero,


Please create a new measure like:

 

Measure = 
VAR _cur_col_name = SELECTEDVALUE('Table'[Column1])
RETURN
SWITCH(
    TRUE(),
    _cur_col_name IN {"A","AA"},"Green",
    _cur_col_name IN {"B","BB"},"Yellow",
    _cur_col_name IN {"C","CC"},"Orange"
)

 

and apply it by field value:

vcgaomsft_0-1700708637514.png

 

vcgaomsft_1-1700708637672.png

Please check the pbix file.

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Anonymous
Not applicable

Hi @WilliamForero

Try setting it up this way.

vcgaomsft_0-1699598305213.png

vcgaomsft_1-1699598374468.png

Apply conditional table formatting in Power BI - Power BI | Microsoft Learn


Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Syndicate_Admin
Administrator
Administrator

hi, @WilliamForero

try to make measure with all condition which you make in your column

Syndicate_Admin
Administrator
Administrator

I don't understand, what should I do

Syndicate_Admin
Administrator
Administrator

Could you tell me how it applies

WilliamForero_0-1699470901780.png

I try to choose the MRC column but it won't let me

hI, @Syndicate_Admin 

 

try to make measure instead of column and then select

Dangar332
Super User
Super User

hi, @Syndicate_Admin 

 

use color code instead of color text

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.