Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

HElP ME

Hello everyone,

 

I have problems and I need to solve

 

I'm pulling information from a text column without standardization..

I need to pull the field "Descrição:: "but I don't have a final delimiter, it's not standardized..

My idea is to pull from "Descrição:: " until next time ":" and clean it later, but I'm not able to

 

My idea of ​​formula in M ​​is this

 

Text.Middle([Notas],
(if Text.Contains([Notas],"Descrição:: ") = true then Text.PositionOf([Notas],"Descrição:: ")+12 else 0 ),(
(Text.PositionOf([Notas],"Operação:: ")) - Text.PositionOf([Notas],"Descrição:: ")+12)

)

 

I even tried in dax

 

TEST =
VAR NOTAS = [Notas]
VAR POSI_DESCRICAO = SEARCH("Descrição:: ",NOTAS,1,BLANK())+13
VAR POSI_DOIS_PONTOS = search(": ",NOTAS,POSI_DESCRICAO,BLANK())
VAR DADOS=IF(POSI_DOIS_PONTOS-POSI_DESCRICAO<0,0,POSI_DOIS_PONTOS-POSI_DESCRICAO)
VAR TUDO_NOTAS = mid(NOTAS,POSI_DESCRICAO,DADOS)
RETURN
TUDO_NOTAS

 

 

  • Hi Anonymous ,

     

    Please add a custom column in Power Query Editor:

     

    = Text.BetweenDelimiters([Text],"Descrição:: ",":")

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • v-kkf-msft's avatar
    v-kkf-msft
    Community Support

    Hi Anonymous ,

     

    Please add a custom column in Power Query Editor:

     

    = Text.BetweenDelimiters([Text],"Descrição:: ",":")

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.