Forum Discussion
Anonymous
2 years agoNot applicable
How do I extract a specific text with a specific text length?
On Power BI, I am trying to extract a 5 digit number from a column with text and numbers, image below. I can extract the numbers from the column using 'Text.Select([Column Name], {"0".."9"})' but I'm...
- Anonymous2 years ago
I am right that you are a beginner with MCode!?
Don't thouch the "x" in this code:
= let x = Text.Select([Cross hire for Contract], {"0".."9"}) in if Text.Length(x)=5 then x else nullAndreas.
dufoq3
2 years agoCommunity Champion
Of course he can do it this way, but it will not extract numbers in case there is a missing space in text like "Cross hire for contract25698"
Anonymous
2 years agoNot applicable
True, but the could first use the replace values function from the GUI to replace "contract" with "contract ", and since that might cause double spaces, use the replace values function to replace " " with " ". Now you can use Text.BetweenDelimiters with "Cross Hire for Contract " and " " as your delimiters.
--Nate