The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello,
I have a column that has a bunch of text in it. I want to create a custom column to search the text and if it sees certain words then enter that word.
Example: I want to search the text if it contains legal in it it then set value ad legal, if it contains Compliance then set value as compliance. I want to do this for 5 words. What foruma can I use in the custom column to do this?
Thank You
?
Solved! Go to Solution.
@Earl40 it is a best practice to add a custom column in Power Query where possible, you can use the following M expression for a new custom column in PQ:
if Text.Contains([Column Name], "Legal") then "Legal" else if Text.Contains([Column Name], "2nd value" then "Some value" else "else value"
read more about text.contains here Text.Contains - PowerQuery M | Microsoft Learn
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi,
Is there a possibility of more than 1 keyword to appear in a sentence? If yes, then what result would you expect. Share some data to work with and show the expected result.
@Earl40 it is a best practice to add a custom column in Power Query where possible, you can use the following M expression for a new custom column in PQ:
if Text.Contains([Column Name], "Legal") then "Legal" else if Text.Contains([Column Name], "2nd value" then "Some value" else "else value"
read more about text.contains here Text.Contains - PowerQuery M | Microsoft Learn
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
69 | |
66 | |
62 | |
48 | |
28 |
User | Count |
---|---|
112 | |
83 | |
66 | |
48 | |
43 |