Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

extract string from values with different len

Hi, I have several Store[point of sale] column values that are compound names, where there is a code and then the actual point of sale name. For example.

123 Ltd. Sea
234 srlsl Montagna
23456 asd Lake

I just want to have the store names Sea, Montagna, Lake appear in a barplot. How do I extract them? Thank you very much

  • Anonymous , You can achieve this using DAX and creating a new calculated column

     

    StoreName =
         VAR StoreText = 'YourTableName'[Store]
         VAR SpacePosition = FIND(" ", StoreText, 1, LEN(StoreText))
         RETURN MID(StoreText, SpacePosition + 1, LEN(StoreText) - SpacePosition)
     
    I have also attached PBIX file with sample data

3 Replies

  • Anonymous , You can achieve this using DAX and creating a new calculated column

     

    StoreName =
         VAR StoreText = 'YourTableName'[Store]
         VAR SpacePosition = FIND(" ", StoreText, 1, LEN(StoreText))
         RETURN MID(StoreText, SpacePosition + 1, LEN(StoreText) - SpacePosition)
     
    I have also attached PBIX file with sample data
  • Anonymous's avatar
    Anonymous
    Not applicable

    Pls check the solution.

  • Anonymous's avatar
    Anonymous
    Not applicable

    thank you, both works