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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors