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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.