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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Serdet
Post Patron
Post Patron

If text contains then make cell blank

Hi,

 

I have a column which  contains a URL. Some of these URL's contain the text "sig".

 

Within Power query is it possible to change any URL containing "sig" to a blank entry?

 

Example before

Url
www.test1234sig.com
www.test1234.com

 

Example after

Url
 
www.test1234.com

 

Many thanks,

 

Elliot 

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1638801202396.png

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @Serdet ,

Does @CNENFRNL 's solution solve your problem, if yes, please kindly accept it as the solution to help the other members find it more quickly.

Best Regards,
Community Support Team _ kalyj

CNENFRNL
Community Champion
Community Champion

 

= Table.ReplaceValue(Source, each [Url], each if Text.Contains([Url], "sig") then "" else [Url], Replacer.ReplaceText, {"Url"})

or

= Table.ReplaceValue(Source, null, null, (x,y,z) => if Text.Contains(x, "sig") then "" else x, {"Url"})

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Hi,

 

I have tried option 1 and replaced each [url] with the relevant column but are abit confused what to do with regards to the {"url"} section as I do not have any text that contains the string "url".

CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1638801202396.png

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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