cancel
Showing results for 
Search instead for 
Did you mean: 
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
Winner of T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Find out who won the T-Shirt Design Challenge and the top 3 finalists.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.