<?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 Extract first n characters if only contains numeric value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-first-n-characters-if-only-contains-numeric-value/m-p/3023486#M102980</link>
    <description>&lt;P&gt;There are values in my column that are both numeric and alphabetical. If the first 4 characters are numbers, I must separate them. If not, I must leave the value alone.&lt;/P&gt;&lt;P&gt;Please consider the following, for instance:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1111 Grape&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Grape&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9999 Apple&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8888 18 Mango&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;18 Mango&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7777 Orange 10&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Orange 10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Strawberry Fruit&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Strawberry Fruit&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Please advise?&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jan 2023 14:28:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-01-16T14:28:34Z</dc:date>
    <item>
      <title>Extract first n characters if only contains numeric value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-first-n-characters-if-only-contains-numeric-value/m-p/3023486#M102980</link>
      <description>&lt;P&gt;There are values in my column that are both numeric and alphabetical. If the first 4 characters are numbers, I must separate them. If not, I must leave the value alone.&lt;/P&gt;&lt;P&gt;Please consider the following, for instance:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1111 Grape&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Grape&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9999 Apple&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8888 18 Mango&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;18 Mango&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7777 Orange 10&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Orange 10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Strawberry Fruit&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Strawberry Fruit&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Please advise?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 14:28:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-first-n-characters-if-only-contains-numeric-value/m-p/3023486#M102980</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-16T14:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extract first n characters if only contains numeric value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-first-n-characters-if-only-contains-numeric-value/m-p/3023560#M102985</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;It is for creating a calculated column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Expected result CC =
VAR _length =
    LEN ( Data[Column A] )
RETURN
    IF (
        NOT ISERROR ( INT ( LEFT ( Data[Column A], 4 ) ) ),
        RIGHT ( Data[Column A], _length - 5 ),
        Data[Column A]
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 16 Jan 2023 14:50:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extract-first-n-characters-if-only-contains-numeric-value/m-p/3023560#M102985</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-01-16T14:50:14Z</dc:date>
    </item>
  </channel>
</rss>

