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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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