<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Extract substring from another column in Power Query based on delimiter in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Extract-substring-from-another-column-in-Power-Query-based-on/m-p/4406021#M59449</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/487628"&gt;@manojk_pbi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I create a sample to have a test. You can do some transformation to add a custom column in Power Query Editor.&lt;/P&gt;
&lt;P&gt;Duplicate Column &amp;gt; Split the copy column by Delimiter "-" &amp;gt; Add a cutom column to check data type in the second splited column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCgjy0jU0MjbRDU7MLchJNdQtM1SK1UESD0ktLoGLhLgGh4A5IFGgVEUJUHUsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column", type text}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Column", "Column - Copy"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Duplicated Column", "Column - Copy", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"Column - Copy.1", "Column - Copy.2", "Column - Copy.3", "Column - Copy.4"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column - Copy.1", type text}, {"Column - Copy.2", type text}, {"Column - Copy.3", type text}, {"Column - Copy.4", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each let
_numbertype = 
Value.Is(Value.FromText([#"Column - Copy.2"]), type number)
in
if _numbertype then [#"Column - Copy.2"] else -99999),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Column - Copy.1", "Column - Copy.2", "Column - Copy.3", "Column - Copy.4"}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Removed Columns",{{"Custom", Int64.Type}})
in
    #"Changed Type2"&lt;/LI-CODE&gt;
&lt;P&gt;By Default:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vrzhoumsft_0-1739326928475.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1237679i465F4486B70E5604/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vrzhoumsft_0-1739326928475.png" alt="vrzhoumsft_0-1739326928475.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vrzhoumsft_1-1739327096712.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1237681i25015513EA125733/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vrzhoumsft_1-1739327096712.png" alt="vrzhoumsft_1-1739327096712.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2025 02:26:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-02-12T02:26:11Z</dc:date>
    <item>
      <title>Extract substring from another column in Power Query based on delimiter</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Extract-substring-from-another-column-in-Power-Query-based-on/m-p/4404482#M59437</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi, I have a column containing text 'PRJ-NNNNN-xxxxxxx-xxxxx' where N represents any single number. Is it possible to create a new custom column in Power Query to have only the number between two hyphen?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We need to have check if number is present , then copy to another column else put -99999&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;eg: PRJ-1234-Sample1-v1 - extract should be &lt;STRONG&gt;1234&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;PRJ-1234-Test - &lt;STRONG&gt;1234&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PRJ-TEST - -&lt;STRONG&gt;99999&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Test-Text1 - -&lt;STRONG&gt;99999&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 07:25:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Extract-substring-from-another-column-in-Power-Query-based-on/m-p/4404482#M59437</guid>
      <dc:creator>manojk_pbi</dc:creator>
      <dc:date>2025-02-11T07:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract substring from another column in Power Query based on delimiter</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Extract-substring-from-another-column-in-Power-Query-based-on/m-p/4406021#M59449</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/487628"&gt;@manojk_pbi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I create a sample to have a test. You can do some transformation to add a custom column in Power Query Editor.&lt;/P&gt;
&lt;P&gt;Duplicate Column &amp;gt; Split the copy column by Delimiter "-" &amp;gt; Add a cutom column to check data type in the second splited column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCgjy0jU0MjbRDU7MLchJNdQtM1SK1UESD0ktLoGLhLgGh4A5IFGgVEUJUHUsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column", type text}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Column", "Column - Copy"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Duplicated Column", "Column - Copy", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"Column - Copy.1", "Column - Copy.2", "Column - Copy.3", "Column - Copy.4"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column - Copy.1", type text}, {"Column - Copy.2", type text}, {"Column - Copy.3", type text}, {"Column - Copy.4", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each let
_numbertype = 
Value.Is(Value.FromText([#"Column - Copy.2"]), type number)
in
if _numbertype then [#"Column - Copy.2"] else -99999),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Column - Copy.1", "Column - Copy.2", "Column - Copy.3", "Column - Copy.4"}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Removed Columns",{{"Custom", Int64.Type}})
in
    #"Changed Type2"&lt;/LI-CODE&gt;
&lt;P&gt;By Default:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vrzhoumsft_0-1739326928475.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1237679i465F4486B70E5604/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vrzhoumsft_0-1739326928475.png" alt="vrzhoumsft_0-1739326928475.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vrzhoumsft_1-1739327096712.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1237681i25015513EA125733/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vrzhoumsft_1-1739327096712.png" alt="vrzhoumsft_1-1739327096712.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 02:26:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Extract-substring-from-another-column-in-Power-Query-based-on/m-p/4406021#M59449</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-12T02:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extract substring from another column in Power Query based on delimiter</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Extract-substring-from-another-column-in-Power-Query-based-on/m-p/4416771#M59564</link>
      <description>&lt;P&gt;Thanks for the sample. Your solution and sample helped me lot.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 02:37:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Extract-substring-from-another-column-in-Power-Query-based-on/m-p/4416771#M59564</guid>
      <dc:creator>manojk_pbi</dc:creator>
      <dc:date>2025-02-19T02:37:42Z</dc:date>
    </item>
  </channel>
</rss>

