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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Re: Editing rows in a column

If I have figures like

  1. AS 1,2,3,4
    2. AS 1,3,4
    And I want to extract only those where 2 appears and put it in a different column, how can I do that?

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @Anonymous ,

 

in addition to the solution @amitchandak already provided here is another one that is a little more detailed. Here the text 1,2,3,4 will be converted into a list, then the list items will be checked if one is 2. This prevents that a list item like 12 will being tested positive.
You can use this snippet inside the Power Query Custom Column dialog:

if List.Contains(
Text.Split( [else] , "," ) , "2" )
then "contains 2"
else "does not contain 2"

A screenshot:

image.png

And the result:

image.png


Hopefully, this provides what you are looking for.

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey @Anonymous ,

 

in addition to the solution @amitchandak already provided here is another one that is a little more detailed. Here the text 1,2,3,4 will be converted into a list, then the list items will be checked if one is 2. This prevents that a list item like 12 will being tested positive.
You can use this snippet inside the Power Query Custom Column dialog:

if List.Contains(
Text.Split( [else] , "," ) , "2" )
then "contains 2"
else "does not contain 2"

A screenshot:

image.png

And the result:

image.png


Hopefully, this provides what you are looking for.

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
amitchandak
Super User
Super User

@Anonymous ,

In a new column power query

if Text.Contains([Column], "2") then [Column] else null

 

in DAX, a new column

 

if(Containsstring([Column], "2") ,[Column] ,blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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