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
STs2207
Frequent Visitor

If then else old value

Hi,

 

I would like to transform the data in one column as follows but cannot find a way to do it. I want to find the cells that start with abc and replace the content of the cell with abc, otherwise leave it as it is.

 

if (contains ([column2], "abc"), then "abc", else return existing string

 

Thanks in advance

1 ACCEPTED SOLUTION
Interkoubess
Solution Sage
Solution Sage

Hi @STs2207,

 

You can use this formula in Query Editor for power Query or use the LEFT function in DAX :

 

if Text.Contains([Column2], "abc") then "abc" else [Column2])

Hope it helps...

 

Ninter

 

View solution in original post

2 REPLIES 2
Interkoubess
Solution Sage
Solution Sage

Hi @STs2207,

 

You can use this formula in Query Editor for power Query or use the LEFT function in DAX :

 

if Text.Contains([Column2], "abc") then "abc" else [Column2])

Hope it helps...

 

Ninter

 

Thank you very much @Interkoubess

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