<?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: Issues with string manipulation script in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3245674#M119573</link>
    <description>&lt;P&gt;You are using&amp;nbsp;&lt;SPAN&gt;'Tickets'[TimeWorked] a lot.&amp;nbsp; Might want to put it in a variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is this a measure or a column?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 21 May 2023 01:46:09 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2023-05-21T01:46:09Z</dc:date>
    <item>
      <title>Issues with string manipulation script</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3243093#M119368</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand what i'm doing wrong. I'm appling this code to a new column called TW&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TW = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ISBLANK&lt;/SPAN&gt;&lt;SPAN&gt;('Tickets'[TimeWorked]), &lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV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PAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"("&lt;/SPAN&gt;&lt;SPAN&gt;, 'Tickets'[TimeWorked], &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;()) - &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;LEFT&lt;/SPAN&gt;&lt;SPAN&gt;('Tickets'[TimeWorked], &lt;/SPAN&gt;&lt;SPAN&gt;SEARCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"min"&lt;/SPAN&gt;&lt;SPAN&gt;,'Tickets'[TimeWorked],&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;()) - &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;in the field&amp;nbsp;'Tickets'[TimeWorked] have 2 value format "15 minutes" or "2.08 hours (125 minutes)"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The error message is "LEFT has the wrong data type or has invalid value" regardless what I tryed, changing with static value in the LEFT statement, nothing works.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm trying to get the minutes value of each field.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Would it be possible to get some help with this.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 May 2023 22:00:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3243093#M119368</guid>
      <dc:creator>Rimo72</dc:creator>
      <dc:date>2023-05-18T22:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with string manipulation script</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3245674#M119573</link>
      <description>&lt;P&gt;You are using&amp;nbsp;&lt;SPAN&gt;'Tickets'[TimeWorked] a lot.&amp;nbsp; Might want to put it in a variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is this a measure or a column?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2023 01:46:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3245674#M119573</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-05-21T01:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with string manipulation script</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3249045#M119819</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="562975" data-lia-user-login="Rimo72" class="lia-mention lia-mention-user"&gt;Rimo72&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The issue is likely with your SEARCH function. When SEARCH can't find the value (e.g. if the row value is blank) this kind of error can appear within LEFT.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You just need adjust your dax formula, please try below dax formula:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TW =
IF (
    ISBLANK ( 'Table'[Time Worked] ),
    BLANK (),
    IF (
        SEARCH ( "(", 'Table'[Time Worked], 1, BLANK () ),
        MID (
            'Table'[Time Worked],
            SEARCH ( "(", 'Table'[Time Worked], 1, BLANK () ) + 1,
            SEARCH ( "min", 'Table'[Time Worked], 1, BLANK () )
                - SEARCH ( "(", 'Table'[Time Worked], 1, BLANK () ) - 2
        ),
        IF (
            ISBLANK ( SEARCH ( "min", 'Table'[Time Worked], 1, BLANK () ) ),
            BLANK (),
            LEFT (
                'Table'[Time Worked],
                SEARCH ( "min", 'Table'[Time Worked], 1, BLANK () ) - 2
            )
        )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please refer the attached .pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team_Binbin Yu&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 06:28:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3249045#M119819</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-23T06:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with string manipulation script</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3249377#M119848</link>
      <description>&lt;P&gt;Thanks it works.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 16:43:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3249377#M119848</guid>
      <dc:creator>Rimo72</dc:creator>
      <dc:date>2023-05-23T16:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with string manipulation script</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3249381#M119849</link>
      <description>&lt;P&gt;I do :). Will follow you recomandation. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 16:44:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issues-with-string-manipulation-script/m-p/3249381#M119849</guid>
      <dc:creator>Rimo72</dc:creator>
      <dc:date>2023-05-23T16:44:08Z</dc:date>
    </item>
  </channel>
</rss>

