Forum Discussion

yodha's avatar
yodha
Icon for Helper IV rankHelper IV
6 years ago
Solved

DAX to Split Text using delimeter.

I need help to Split this text based on delimeter "Comma"

can anyone help me with "DAX"?

 

Thanks in Advance

  • yodha

    try

     

    Column =

    var _start = SEARCH("""Type", [Column1],,0)

    var _finish = SEARCH(",", [Column1], _start)

    RETURN

    IF(_start > 0, MID([Column1], _start, _finish - _start), BLANK() )

7 Replies

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Hi yodha 

    try

    Column = 
    var _start = SEARCH("""Type", [Column1])
    var _finish = SEARCH(",", [Column1], _start)
    RETURN
    MID([Column1], _start, _finish - _start)
    • yodha's avatar
      yodha
      Icon for Helper IV rankHelper IV

      az38 : Thank you so much for the response but this is giving me error because few rows doesn't contain "Type" in my Table, can you tell me how to modify this DAX ?  

      • az38's avatar
        az38
        Icon for Community Champion rankCommunity Champion

        yodha

        try

         

        Column =

        var _start = SEARCH("""Type", [Column1],,0)

        var _finish = SEARCH(",", [Column1], _start)

        RETURN

        IF(_start > 0, MID([Column1], _start, _finish - _start), BLANK() )

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi yodha 

     

    Can you not do it in Power Quer?

     

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn

     

    • yodha's avatar
      yodha
      Icon for Helper IV rankHelper IV

      Mariusz : no, i need to use DAX, the above DAX is looking fine but it's just giving me error because few rows in my table doen't have "Type", thank you.

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi yodha 

     

    With Power Query is as simple as selecting your string column, follow the below.

    and expand Type,

     

    Please see the attached for ref.

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn