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! Learn more

Reply
tkchan08
New Member

If column contains values from another column replace with valu

Hi Everyone,


If I have a table similar to below and I would like to search if any of the values in column Y exist in column x.  If it exists, I would like to replace the value with a Blank and output to a new colum.  For example, in row one column x, becomes 2+3+4+67 in the new column. 

 

 

Table1 
Column XColumn Y
1+2+3+4+671

 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @tkchan08 

 

You can also try to solve it with Dax.

Column =
IF (
    SEARCH ( [Column Y], [Column X] ) <> BLANK (),
    REPLACE ( [Column X], FIND ( [Column Y], [Column X] ), 2, BLANK () )
)

vzhangti_0-1661503436005.png

 

For reference:

FIND function (DAX) - DAX | Microsoft Docs

SEARCH function (DAX) - DAX | Microsoft Docs

REPLACE function (DAX) - DAX | Microsoft Docs

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @tkchan08 

 

You can also try to solve it with Dax.

Column =
IF (
    SEARCH ( [Column Y], [Column X] ) <> BLANK (),
    REPLACE ( [Column X], FIND ( [Column Y], [Column X] ), 2, BLANK () )
)

vzhangti_0-1661503436005.png

 

For reference:

FIND function (DAX) - DAX | Microsoft Docs

SEARCH function (DAX) - DAX | Microsoft Docs

REPLACE function (DAX) - DAX | Microsoft Docs

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@tkchan08 ,

 

In Power Query create a new column

 

Text.Combine(List.RemoveItems(Text.Split([Column X], "+"), {[Column Y]}), "+")

 

In case Y is numeric column. Above will work with text column

Text.Combine(List.RemoveItems(Text.Split([Column X], "+"), {Number.ToText([Column Y])}), "+")

 

 

If need use Text.Split on Y

 

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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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