In February 2023 Power BI released new feature – “Conditional Formatting based on string fields”. You can now set conditional formatting rules based on string fields.
Following the below steps-
Step1: Add column chart with some fields. See the below given screen shot.
In X-axis you can see the two fields Segment
& Product
. And in Y-axis Sale Price
.

Column chart PBI
Step 2: Select the visual and go to the Format visual tab >Expand Column section> under Colors section click on fx icon just next to Default.

Column Property
Step-3: One dialog box opens > choose Rules in format style > Select Column name > Type String/Text value > OK.

Conditional formatting by string PBI
Step-4: Now you can see the final result as below.

Conditional Formatting by String Result
Chart color has been changed based on string fields value.
Refer other Power BI topics: Power BI tutorials