Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Extract text after delimiter using DAX

Hi everyone, I am trying to write a DAX code to extract the text after delimitter. 
Example Dataset: 

Charge CodeExpected Output
AON05-0009-EIEI
AON008-SS
BT01-0002-ELEL

 

 

Phase = 
RIGHT(
    'Table'[Charge Code], 
    SEARCH("-",'Table'[Charge Code],)-4)

 

I tried to use the above code but it does not work fine. Can anyone please help me to extract the text after the second delimited using DAX? 

I also tried using PowerQuery but when I give condition to skip first delimitter, I am getting blanks for a few chargecodes (for ex: AON008-S in the data above)

Somebody please help me out with this problem. Thank you in advance! 

  • Hi Anonymous 

     

    In Power Query, you have an option to split at right most delimiter. Would it solve your problem?

     

     

2 Replies

  • Hi Anonymous 

     

    In Power Query, you have an option to split at right most delimiter. Would it solve your problem?

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi coskuersanli  thanks this worked!! I was not aware of this function.