Hello,
I am looking for a solution to replace multiple substrings at once.
For Example:
Category | Category after |
AA_A | AB_A |
aa_B | AB_B |
AA_C | AB_C |
BB_A | DE_A |
BB_B | DE_B |
BB_C | DE_C |
so AA->AB, aa->AB and BB->DE.
I found something here, but it is not able to replace substrings and it creates three single steps.
My aim would be to do it in one single step.
I'm really looking forward for your feedback.
Solved! Go to Solution.
Hi @Floriankx,
Here are some blogs written about multiple replacements of words with Power Query:
Multiple replacements or translations in Power BI and Power Query
Multiple replacements of words in Power Query
Replace multiple values in a single step
Regards,
Yuliana Gu
Hi, @Floriankx
Try the following M formula in Query Editor:
Text.Combine( List.ReplaceMatchingItems(
Text.Split ([Category], ”_“), { {“AA”, “AB”} , {“aa”, ”AB“} , {“BB” , “DE” } }
))
Here is more information to assist you:
https://www.syntelli.com/easy-guide-to-bulk-replace-values-in-power-bi-or-power-query
Let me know if it works!
Hi @Floriankx,
Here are some blogs written about multiple replacements of words with Power Query:
Multiple replacements or translations in Power BI and Power Query
Multiple replacements of words in Power Query
Replace multiple values in a single step
Regards,
Yuliana Gu
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!
User | Count |
---|---|
204 | |
70 | |
69 | |
57 | |
57 |
User | Count |
---|---|
251 | |
220 | |
105 | |
75 | |
74 |