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
Dhruvin
Helper III
Helper III

How to create M function to Find and Replace the Value?

I know, Power BI provide Replace fiunction Out Of the Box.

Still, I want to create a Custom Function (M function) which will read value from the dataset for find and Replace with a word. 

How to create this function and call the function on a specific column of a table.

 

Example: 

 

I have County column in a database. For County I want to create a function which will read the Find value from another dataset and replace found word with another column named "Replaced value".

 

How to achieve this requirement?

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

If you are willing to use another column, you can simply join the two tables.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-juanli-msft
Community Support
Community Support

Hi @Dhruvin

Let me confirm the requirement with you

find the value "a" in "country" column in table1, then replace the "a" with another value from another table.

 

If my understanding is correct, here is a thread you could refer to

https://community.powerbi.com/t5/Desktop/Query-editor-replacing-values-based-on-another-column/td-p/...

 

Best Regards

Maggie

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.