cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
doubleclick
Helper I
Helper I

Make Text.Replace Case Insensitive

I want to replace any instance of Ltd, whether it's ltd or LTD or Ltd

 

I did a simple right click, replace text and have been experimenting with the comparer.orignalignorecase function but unable to determine where to put it:

 

Here's my formula:

= Table.ReplaceValue(#"Renamed Columns","LTD","",Replacer.ReplaceText,{"Supplier (cleansed)"})

 

Can anyone help?

1 ACCEPTED SOLUTION

the solution is found here: please can you delete this entire post

 

https://community.powerbi.com/t5/Power-Query/Make-Text-Replace-Case-Insensitive-should-be-easy-but-i...

= Text.Combine(List.RemoveMatchingItems(Text.Split([#"Supplier (cleansed)"]," "),{"ltd"},Comparer.OrdinalIgnoreCase)," ")

 

 

 

View solution in original post

7 REPLIES 7
doubleclick
Helper I
Helper I

can this post be deleted as no one seems to have an answer

Hi, @doubleclick 

List.ReplaceMatchitems is a function manipulate list values.

And you can place the comparer.orignalignorecase function as below:

 

= Table.AddColumn(#"Renamed Columns", "Custom", each Text.Combine(List.ReplaceMatchingItems({[#"Supplier (cleansed)"]},{{"ltd","Ltd"}},Comparer.OrdinalIgnoreCase)))

 

 10.png

 

Plesae check my attached pbix.

 

Best Regards,
Community Support Team _ Eason

the solution is found here: please can you delete this entire post

 

https://community.powerbi.com/t5/Power-Query/Make-Text-Replace-Case-Insensitive-should-be-easy-but-i...

= Text.Combine(List.RemoveMatchingItems(Text.Split([#"Supplier (cleansed)"]," "),{"ltd"},Comparer.OrdinalIgnoreCase)," ")

 

 

 

CNENFRNL
Super User
Super User

= Table.ReplaceValue(#"Renamed Columns", null, null, (x,y,z) => Text.Replace(Text.Upper(x),"LTD",""), {"Supplier (cleansed)"})

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 beyond their comprehension!

DAX is simple, but NOT EASY!

this is only one variation?

i thought one of you da geniuses could do this easy

Samarth_18
Super User
Super User

Hi @doubleclick ,

 

Please try below approach.

 

https://www.youtube.com/watch?v=-oM83cgs5uI 

 

Thanks,

Samarth


If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin


I watched this already - can someone help with the code?

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors