<?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: SUBSITUTE function does not work correctly in DirectQuery mode in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011431#M102104</link>
    <description>&lt;P&gt;The errors is:&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;Function 'SUBSTITUTE' is not allowed as part of calculated column DAX expressions on DirectQuery expressions on DirectQuery models.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jan 2023 14:45:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-01-10T14:45:01Z</dc:date>
    <item>
      <title>SUBSITUTE function does not work correctly in DirectQuery mode</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011396#M102101</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;&lt;BR /&gt;I would like to find a solution for a problem regarding the SUBSITUTE function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a string of procceses in the following format:&lt;/P&gt;&lt;P&gt;[|Process1|,|Process2|,|Proces3|, ...]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to split this string into multiple columns in order to have each process in a separat column. I find the solution, but when I tried to integrate it on one project that uses DirectQuery as Storage Mode I realize that my logic does not work because the SUBSTITUTE function accept only 3 parameters, not 4 as it works in the Import Mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The syntax I used is the following:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUBSTITUTE&lt;/SPAN&gt;&lt;SPAN&gt;(Table1[Processes_0],&lt;/SPAN&gt;&lt;SPAN&gt;"|,|"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"*"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It does not work on DirectQuery due to the 4th parameter. I need to replace that grouping of symbols "|,|" based on the number of the instance.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Could you help me please with a solution to the problem presented above?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 14:34:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011396#M102101</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-10T14:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: SUBSITUTE function does not work correctly in DirectQuery mode</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011431#M102104</link>
      <description>&lt;P&gt;The errors is:&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;Function 'SUBSTITUTE' is not allowed as part of calculated column DAX expressions on DirectQuery expressions on DirectQuery models.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 14:45:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011431#M102104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-10T14:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: SUBSITUTE function does not work correctly in DirectQuery mode</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011432#M102105</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Why can't you just turn it into a PATH by replacing each instance with "|". Why do you need to replace each one individually?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 14:45:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011432#M102105</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-01-10T14:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: SUBSITUTE function does not work correctly in DirectQuery mode</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011478#M102112</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your message!&lt;BR /&gt;For example, in order to extract the second process from a string that contains 6 processes the code is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DI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/SPAN&gt;&lt;SPAN&gt; Final)&lt;BR /&gt;&lt;BR /&gt;Is the case more clear now?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Diana &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Jan 2023 14:55:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011478#M102112</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-10T14:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: SUBSITUTE function does not work correctly in DirectQuery mode</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011546#M102119</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Any chance you can use a measure? More DAX functions are supported in measures rather than calculated columns. Also, if you can use SUBSTITUTE in a measure and replace all occurences with "|" (pipe character) then you can use PATHITEM to retrieve individual parts instead of using FIND, MID, etc.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 15:16:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3011546#M102119</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-01-10T15:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: SUBSITUTE function does not work correctly in DirectQuery mode</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3016116#M102430</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you a lot for the solution.&lt;/P&gt;&lt;P&gt;I used the PATHITEM function to split my string in multiple columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a wonderful day!&lt;BR /&gt;Dia&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 08:27:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUBSITUTE-function-does-not-work-correctly-in-DirectQuery-mode/m-p/3016116#M102430</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-12T08:27:40Z</dc:date>
    </item>
  </channel>
</rss>

