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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
DavidMG82
Helper I
Helper I

Bar Chart, Bar color by formula text contains

Hi everyone, im currently working with the formula below having good results for specific text contain on a field, but what if I would like to color green all the fields that contains the word "Yes", any advice will be very appreciated. Thanks ahead.

 

barColor = SWITCH(
   
    TRUE(),
   
    MIN('IGAnswers'[Answer1]) = "Yes", "#00A3A1",
    MIN('IGAnswers'[Answer1]) = "Completed", "#00A3A1",
    MIN('IGAnswers'[Answer1]) = "Partially", "#F4C430",
    MIN('IGAnswers'[Answer1]) = "No", "#BC204B",
    MIN('IGAnswers'[Answer1]) = "Not Completed", "#BC204B",
    "#D3D3D3"

)
1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @DavidMG82 
Try to modify your formula to :

barColor = SWITCH(
   
    TRUE(),
   
   
 CONTAINSSTRING(MIN('IGAnswers'[Answer1]),"Yes") = TRUE(),  "#00A3A1",
    MIN('IGAnswers'[Answer1]) = "Completed", "#00A3A1",
    MIN('IGAnswers'[Answer1]) = "Partially", "#F4C430",
    MIN('IGAnswers'[Answer1]) = "No", "#BC204B",
    MIN('IGAnswers'[Answer1]) = "Not Completed", "#BC204B",
    "#D3D3D3"

OR just use generic conditional options of the UX:
Ritaf1983_0-1686711671900.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
DavidMG82
Helper I
Helper I

Thanks @Ritaf1983 , I should have explored more on the default options, have a great day.

Hi @DavidMG82

I was happy to assist,  please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Ritaf1983
Super User
Super User

Hi @DavidMG82 
Try to modify your formula to :

barColor = SWITCH(
   
    TRUE(),
   
   
 CONTAINSSTRING(MIN('IGAnswers'[Answer1]),"Yes") = TRUE(),  "#00A3A1",
    MIN('IGAnswers'[Answer1]) = "Completed", "#00A3A1",
    MIN('IGAnswers'[Answer1]) = "Partially", "#F4C430",
    MIN('IGAnswers'[Answer1]) = "No", "#BC204B",
    MIN('IGAnswers'[Answer1]) = "Not Completed", "#BC204B",
    "#D3D3D3"

OR just use generic conditional options of the UX:
Ritaf1983_0-1686711671900.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.