<?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: Find the text from string and remove remain part in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3261137#M120588</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="568021" data-lia-user-login="Nurzh" class="lia-mention lia-mention-user"&gt;Nurzh&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I knew my solution is greedy in terms of resources, but 6-7 hours - wow.&lt;/P&gt;&lt;P&gt;I will think how to opimize my [DAX] solution - not sure that I will be able to turn hours into minutes, but I'll try.&amp;nbsp;Before that, could you please clarify how many "master" entries you have among those 2.8 million rows?&lt;/P&gt;&lt;P&gt;As for the Power Query solution, maybe it is worth duplicating this post in the "Power Query" section of this forum - I guess Power Query gurus live there. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 31 May 2023 07:16:13 GMT</pubDate>
    <dc:creator>barritown</dc:creator>
    <dc:date>2023-05-31T07:16:13Z</dc:date>
    <item>
      <title>Find the text from string and remove remain part</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3258403#M120406</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like to create a new column in a table that will show me number of Master Document for Project Copies.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table "Document"&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Document Number&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Document Category&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;EM&gt;61-2300-P-5090&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;Master Document&lt;/EM&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090-07812&lt;/TD&gt;&lt;TD&gt;Project Working Copy&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090-05908P&lt;/TD&gt;&lt;TD&gt;Project Working Copy&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090-05908T1&lt;/TD&gt;&lt;TD&gt;Project Working Copy&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090-05908T&lt;/TD&gt;&lt;TD&gt;Project Working Copy&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090-07812-21&lt;/TD&gt;&lt;TD&gt;Project Working Copy&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired New Column that will identify us the Number of Master Document of this copies:&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Document Number&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Document Category&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;New column (Master Documents)&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090&lt;/TD&gt;&lt;TD&gt;Master Document&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;61-2300-P-5090&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090-07812&lt;/TD&gt;&lt;TD&gt;Project Working Copy&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;61-2300-P-5090&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090-05908P&lt;/TD&gt;&lt;TD&gt;Project Working Copy&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;61-2300-P-5090&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090-05908T1&lt;/TD&gt;&lt;TD&gt;Project Working Copy&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;61-2300-P-5090&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090-05908T&lt;/TD&gt;&lt;TD&gt;Project Working Copy&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;61-2300-P-5090&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61-2300-P-5090-07812-21&lt;/TD&gt;&lt;TD&gt;Project Working Copy&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;61-2300-P-5090&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more thing is the lenght of Master Documents can be different and we need to check it by Category.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this code, but it does not work correctly:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;document master = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR CurrentCategory = Document[DocumentSourceCategory]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR CurrentNumber = Document[DocumentNumber]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR IsMasterDocument = CurrentCategory = "Master Document"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR MasterNumber =&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; IF(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IsMasterDocument,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CurrentNumber,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LEFT(CurrentNumber, IFERROR(FIND("-", CurrentNumber) - 1, LEN(CurrentNumber)) &amp;nbsp;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; MasterNumber&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you for any help!&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 29 May 2023 21:06:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3258403#M120406</guid>
      <dc:creator>Nurzh</dc:creator>
      <dc:date>2023-05-29T21:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Find the text from string and remove remain part</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3259782#M120496</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="568021" data-lia-user-login="Nurzh" class="lia-mention lia-mention-user"&gt;Nurzh&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Please try this calculated column versus your data:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;And in plain text for convenience:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Document Master = 
VAR CurrentNumber = [Document Number]
RETURN MINX (
        FILTER (
            ADDCOLUMNS (    
                FILTER ( ALL ( Document ), Document[Document Category] = "Master Document" ),
                "Match",
                VAR CurrentMaster = [Document Number]
                RETURN CONTAINSSTRING ( CurrentNumber, CurrentMaster ) ),
            [Match] = TRUE () ), 
        [Document Number] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank" rel="noopener"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank" rel="noopener"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 13:52:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3259782#M120496</guid>
      <dc:creator>barritown</dc:creator>
      <dc:date>2023-05-30T13:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Find the text from string and remove remain part</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3260907#M120564</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="518952" data-lia-user-login="barritown" class="lia-mention lia-mention-user"&gt;barritown&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your solution,&lt;/P&gt;&lt;P&gt;it really works, but I have 2.8 million rows in my table, and now almost 6-7 hours I am waiting for the result, it just stuck on&amp;nbsp;"Working on it"...&lt;/P&gt;&lt;P&gt;Is there any other&amp;nbsp; ways to realise it, maybe in Power query?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 04:29:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3260907#M120564</guid>
      <dc:creator>Nurzh</dc:creator>
      <dc:date>2023-05-31T04:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find the text from string and remove remain part</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3261137#M120588</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="568021" data-lia-user-login="Nurzh" class="lia-mention lia-mention-user"&gt;Nurzh&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I knew my solution is greedy in terms of resources, but 6-7 hours - wow.&lt;/P&gt;&lt;P&gt;I will think how to opimize my [DAX] solution - not sure that I will be able to turn hours into minutes, but I'll try.&amp;nbsp;Before that, could you please clarify how many "master" entries you have among those 2.8 million rows?&lt;/P&gt;&lt;P&gt;As for the Power Query solution, maybe it is worth duplicating this post in the "Power Query" section of this forum - I guess Power Query gurus live there. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 07:16:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3261137#M120588</guid>
      <dc:creator>barritown</dc:creator>
      <dc:date>2023-05-31T07:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Find the text from string and remove remain part</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3261158#M120589</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="518952" data-lia-user-login="barritown" class="lia-mention lia-mention-user"&gt;barritown&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is approximately 2.7 million&amp;nbsp; of them "Master Documents".&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sure I will try to duplicate post in Power Query section, thank you, hope we can find the best solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 07:29:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3261158#M120589</guid>
      <dc:creator>Nurzh</dc:creator>
      <dc:date>2023-05-31T07:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Find the text from string and remove remain part</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3261607#M120639</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="568021" data-lia-user-login="Nurzh" class="lia-mention lia-mention-user"&gt;Nurzh&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I am not sure it will work with your big dataset, but you can try the following in Power Query:&lt;/P&gt;&lt;P&gt;1) Sort your table by "Document Number".&lt;/P&gt;&lt;P&gt;2) Add a conditional column.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;3) Apply "Fill Down" form the newly created column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 10:15:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-the-text-from-string-and-remove-remain-part/m-p/3261607#M120639</guid>
      <dc:creator>barritown</dc:creator>
      <dc:date>2023-05-31T10:15:29Z</dc:date>
    </item>
  </channel>
</rss>

