Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
yodha
Helper IV
Helper IV

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

1 ACCEPTED SOLUTION
az38
Community Champion
Community 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() )


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

7 REPLIES 7
Mariusz
Community Champion
Community Champion

Hi @yodha 

 

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

Mariusz_0-1594209103020.png

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

 

Mariusz
Community Champion
Community 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

 

@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.

az38
Community Champion
Community Champion

Hi @yodha 

try

Column = 
var _start = SEARCH("""Type", [Column1])
var _finish = SEARCH(",", [Column1], _start)
RETURN
MID([Column1], _start, _finish - _start)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@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
Community Champion
Community 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() )


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.