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
Anonymous
Not applicable

splitting delimiter in column and make exception

Hi guys,

Hope you can help me with this issue.

 

I'm Splitting a column by delimiter and it looks like this:

    #"Split Column by Delimiter" = Table.SplitColumn(#"Duplicated Column1", "xxx", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"xxx1", "xxx2"}),

As you can see, I use "-" to split the text.

But I need to make an exception on it. 

If it recognizes "- SpecificWord" so don't split it.

 

Any idea how I can make it work?

Thank you!

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

Try using the below DAX to create the calculated column.

Here Data[Name] is the field which is to be split.

 
column_name =
VAR split_string = PATHITEM(SUBSTITUTE(Data[Name], "-", "|"), 2)
RETURN
IF( split_string == "specific string", Data[Name], split_string )
 
Thanks.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi,

Try using the below DAX to create the calculated column.

Here Data[Name] is the field which is to be split.

 
column_name =
VAR split_string = PATHITEM(SUBSTITUTE(Data[Name], "-", "|"), 2)
RETURN
IF( split_string == "specific string", Data[Name], split_string )
 
Thanks.

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.

Top Solution Authors