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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
tracyhopaulson
Resolver I
Resolver I

if statement custom column

I have a column "Item" that I would like to find all values start with "SK" or "78", then insert a text "Do Not Use" to the custom column, otherwise, carry the values from column Item over as is.  Can someone help with this please?

1 ACCEPTED SOLUTION
pranit828
Community Champion
Community Champion

Hi @tracyhopaulson 

 

I would create  a column

_new_column = IF(LEFT([column],2) IN {"SK","78"}, "Do Not Use",[column])





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

View solution in original post

5 REPLIES 5
pranit828
Community Champion
Community Champion

Hi @tracyhopaulson 

 

I would create  a column

_new_column = IF(LEFT([column],2) IN {"SK","78"}, "Do Not Use",[column])





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile
Ajinkya369
Resolver III
Resolver III

Hi @tracyhopaulson ,

 

Please provide sample data.

 

Thank you

@Ajinkya369  attaching image of data and the result I would like to achieve.  Need help with Dax formula or custom column formula please.  Thank you.

sample.PNG

 

 

@tracyhopaulson

Using the CONTAINSSTRING function:

CONTAINSSTRING.JPG





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






PaulDBrown
Community Champion
Community Champion

@tracyhopaulson 

You can create a custom column in Power Query to meet the output. The interface will allow you to choose between "contains" (to specify the string values) and the output can be custom or a column value

As an alternative, you can create a custom column using DAX in your table using the function CONTAINSTRING as the variable





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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