Forum Discussion
any function can do exact match (text) in power query?
- 7 years ago
Thanks for replying my question. Here is the screeshot.
Now, if I use the above mentioned nested function searching "lock", it not only returns the text containing the word "lock" but also text containing "block". That's why I want some function can do exact match.
If DAX helps out, I'll surely embrace it :)
Hi,
How do we make the software understand that block should be ignored but padlock should be considered (when there is no space between pad and lock)
- Anonymous7 years agoNot applicable
Hi,
We created a column on a condition saying that, if the string contains "block" then block else "lock".
Power BI will search for the defined string in the condition and will reteun the expected results.
Hope I have answered your question.
Regards,
Pavan Vanguri.
- Ashish_Mathur7 years ago
Super User
No, you have not. Suppose there was a word bullock, you would have to create an exception for this as well. There will be countless such words.
- Jun_Wang7 years ago
Advocate I
Yes yes yes, you are right.
I pre-define a collection of words to define it is a lock issue, padlock is one of them as well. I didn't show all my script (trying to catch attention on exact match).
But the issue is, if the text only mention "lock" and I use the word "lock", the result will bring other words containing "^lock"......This makes my life difficult :(
- Ashish_Mathur7 years ago
Super User
Hi,
Share some sample data (which i can paste in an Excel file) and a table showing the words that you would like to be treated as lock.
- Jun_Wang7 years ago
Advocate I
Really appreciated your help. Here are some text.
I cleaned the data from R, so there is no singular and plura problem. My predefined list is shorten the if-else will go through in the order like below:
1) List.ContainsAll({"door","lock"}
2) List.ContainsAll({"key","lock"}
3) text.contain ("lock", "padlock", "locksmith")
The above 1) and 2) will use the nested text.splitany() by space :)
Many thanks.
block toilet haywards ac substation. wdv supply chain padlock road gate dvk lock toilet cubicle door portacom smoko sheed missing lock entry door design hand injury potential due proximaty lock door jamb sbk southbrook substation - block toilet isl - break door lock transfield office investigate blockage drain main driveway haywards toilet block ac ay lock mechanism switchyard b man gate accept key condenser internal door lock ac fall apart esni lock gate hot water unit toilet block need replacement leak flood toilet block wvy - rust screw exterior amenity block wairaki investigation electronic door lock control door. need replacement igh - unblock drain