cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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.
1 REPLY 1
Highlighted
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.

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 388 members 3,471 guests
Please welcome our newest community members: