cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
powerbi10 Visitor
Visitor

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

Accepted Solutions
vaibhavdesai Established Member
Established Member

Re: splitting delimiter in column and make exception

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
vaibhavdesai Established Member
Established Member

Re: splitting delimiter in column and make exception

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

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 101 members 1,383 guests
Please welcome our newest community members: