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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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