<?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: Force Convertion of String to Number using Dax in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Force-Convertion-of-String-to-Number-using-Dax/m-p/3517241#M135057</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;The solution provided&amp;nbsp;&lt;STRONG&gt;Did not work&lt;/STRONG&gt; for the intended purpose at all.&lt;/P&gt;&lt;P&gt;When using it I got an error: "Expressions that yield variant data-type cannot be used to define calculated columns".&lt;BR /&gt;&lt;BR /&gt;An Example of my problem, and how I would like the solution (using 0.04 as error code)&lt;BR /&gt;14.45&amp;nbsp; --&amp;gt; 14.45&lt;BR /&gt;14#&amp;nbsp; --&amp;gt; 0.04&lt;BR /&gt;103 --&amp;gt; 103&lt;BR /&gt;$18 --&amp;gt; 0.04&lt;BR /&gt;&lt;BR /&gt;when trying to use 0.04 instead of "Not number", all rows became 0.04&lt;BR /&gt;&lt;BR /&gt;Any other idea with this?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2023 08:17:28 GMT</pubDate>
    <dc:creator>NPbon</dc:creator>
    <dc:date>2023-11-06T08:17:28Z</dc:date>
    <item>
      <title>Force Convertion of String to Number using Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Force-Convertion-of-String-to-Number-using-Dax/m-p/3507365#M134554</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a column that was created with DAX (hence &lt;STRONG&gt;cannot use power query&lt;/STRONG&gt;) as a Text that needs to be converted to Number.&lt;/P&gt;&lt;P&gt;However, sometimes on this column there are non-numerical, non-roman characters as the source is taken from multiple languages around the world.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using CONVERT function, if only in one of the rows there is a special character, all rows are changed to&amp;nbsp; #Error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to know if there is a function that forces the convertion (omitting or deleting the special character) or at least that changes to #Error only the row with the problem, and not the entire column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 14:21:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Force-Convertion-of-String-to-Number-using-Dax/m-p/3507365#M134554</guid>
      <dc:creator>NPbon</dc:creator>
      <dc:date>2023-10-31T14:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Force Convertion of String to Number using Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Force-Convertion-of-String-to-Number-using-Dax/m-p/3510938#M134719</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="639464" data-lia-user-login="NPbon" class="lia-mention lia-mention-user"&gt;NPbon&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Plese try to identify the column firstly, then convert the data type, please try to create a column like below dax formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR cur_val = [Column Name]
VAR _a =
    SWITCH (
        TRUE (),
        ISNUMBER ( cur_val ), CONVERT ( cur_val, INTEGER ),
        ISNONTEXT ( cur_val ), CONVERT ( cur_val, INTEGER ),
        "Not number"
    )
RETURN
    _a
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&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>Thu, 02 Nov 2023 03:38:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Force-Convertion-of-String-to-Number-using-Dax/m-p/3510938#M134719</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-02T03:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Force Convertion of String to Number using Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Force-Convertion-of-String-to-Number-using-Dax/m-p/3517241#M135057</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;The solution provided&amp;nbsp;&lt;STRONG&gt;Did not work&lt;/STRONG&gt; for the intended purpose at all.&lt;/P&gt;&lt;P&gt;When using it I got an error: "Expressions that yield variant data-type cannot be used to define calculated columns".&lt;BR /&gt;&lt;BR /&gt;An Example of my problem, and how I would like the solution (using 0.04 as error code)&lt;BR /&gt;14.45&amp;nbsp; --&amp;gt; 14.45&lt;BR /&gt;14#&amp;nbsp; --&amp;gt; 0.04&lt;BR /&gt;103 --&amp;gt; 103&lt;BR /&gt;$18 --&amp;gt; 0.04&lt;BR /&gt;&lt;BR /&gt;when trying to use 0.04 instead of "Not number", all rows became 0.04&lt;BR /&gt;&lt;BR /&gt;Any other idea with this?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 08:17:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Force-Convertion-of-String-to-Number-using-Dax/m-p/3517241#M135057</guid>
      <dc:creator>NPbon</dc:creator>
      <dc:date>2023-11-06T08:17:28Z</dc:date>
    </item>
  </channel>
</rss>

