Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    2 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 null

     

    Andreas.