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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Yannyqi
Frequent Visitor

How to replace multiple inconsistent values with 1 same value

Hi everyone,

 

I am new to Power BI and currenlty looking for a solution to replace multiple inconsistent values with 1 same value. eg. one of the columns named "Address" includes values in a different format e.g. "Japan", "Jap", "JP", "JPN", "Japan, Osaka"; all of them refers to "Japan" and I would like to standardize by changing it to "Japan".

 

May I know is there any simpler way to replace all these different values to Japan efficiently? Instead of using the "Find and Replace Values" method to replace the values 1 by 1?

 

Any help would be really appreciated.

 

Thank you very much in advance.

2 ACCEPTED SOLUTIONS
mahoneypat
Employee
Employee

Please see this article.  Basically, you need to create a list of lists to be used inside a step with List.ReplaceMatchingItems().

Multiple replacements or translations in Power BI and Power Query – The BIccountant

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

v-yingjl
Community Support
Community Support

Hi @Yannyqi ,

If the values of columns are like a sentence within the above strings, you can refer the article mentioned by @ mahoneypat to replace values at once.

 

If the values of columns are like a single character such as JP, JPN etc. for each row, perhaps create a query to replace it at the same time is better:

 A1.png

= Table.ReplaceValue(#"Changed Type",each [Address],"Japan",Replacer.ReplaceText,{"Address"})

A2.png

 

Best Regards,
Community Support Team _ Yingjie Li
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

4 REPLIES 4
v-yingjl
Community Support
Community Support

Hi @Yannyqi ,

If the values of columns are like a sentence within the above strings, you can refer the article mentioned by @ mahoneypat to replace values at once.

 

If the values of columns are like a single character such as JP, JPN etc. for each row, perhaps create a query to replace it at the same time is better:

 A1.png

= Table.ReplaceValue(#"Changed Type",each [Address],"Japan",Replacer.ReplaceText,{"Address"})

A2.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yingjl ,

 

Thank you very much, i will try it out with this 😀

mahoneypat
Employee
Employee

Please see this article.  Basically, you need to create a list of lists to be used inside a step with List.ReplaceMatchingItems().

Multiple replacements or translations in Power BI and Power Query – The BIccountant

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you so much! I will try it out 😀

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.

Top Solution Authors
Top Kudoed Authors