<?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 Issue with Value() function converting string to number in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Value-function-converting-string-to-number/m-p/2667850#M79415</link>
    <description>&lt;P&gt;I am using a switch formula to simplify and bucket a column of mixed numeric and text values. The goal is to simplify values that are numeric with text to just the number. (For example, I have these values in the column: "2", "2g", "2 g"&amp;nbsp; and I want all of them to be returned as "2".) There are some values in the column that do not have any numbers such as "dg" and "ph". I used the formula ISERROR(VALUE([mycolumn])) within my switch formula to return a value of "Other" for these values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is with one single row that has the value "2a". This does NOT return as an error within the VALUE() function. It actually returns a value of 0.0833333 for a reason I can't figure out.&amp;nbsp; Is "a" some stored variable? What is going on and how can I fix it??&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 17:17:33 GMT</pubDate>
    <dc:creator>aallman</dc:creator>
    <dc:date>2022-07-28T17:17:33Z</dc:date>
    <item>
      <title>Issue with Value() function converting string to number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Value-function-converting-string-to-number/m-p/2667850#M79415</link>
      <description>&lt;P&gt;I am using a switch formula to simplify and bucket a column of mixed numeric and text values. The goal is to simplify values that are numeric with text to just the number. (For example, I have these values in the column: "2", "2g", "2 g"&amp;nbsp; and I want all of them to be returned as "2".) There are some values in the column that do not have any numbers such as "dg" and "ph". I used the formula ISERROR(VALUE([mycolumn])) within my switch formula to return a value of "Other" for these values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is with one single row that has the value "2a". This does NOT return as an error within the VALUE() function. It actually returns a value of 0.0833333 for a reason I can't figure out.&amp;nbsp; Is "a" some stored variable? What is going on and how can I fix it??&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 17:17:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Value-function-converting-string-to-number/m-p/2667850#M79415</guid>
      <dc:creator>aallman</dc:creator>
      <dc:date>2022-07-28T17:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Value() function converting string to number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Value-function-converting-string-to-number/m-p/2667868#M79423</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="418631" data-lia-user-login="aallman" class="lia-mention lia-mention-user"&gt;aallman&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;It is not simple simple as you may think it is. However, might not be so coplex but relly depends on the shape of your data. Please provide a reasonable and relevent sample of data to work with.&amp;nbsp;&lt;BR /&gt;On the other hand a power bi column can only contain data of one data type. In case of error you can return blank not a string.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 17:27:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Value-function-converting-string-to-number/m-p/2667868#M79423</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-28T17:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Value() function converting string to number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Value-function-converting-string-to-number/m-p/2667892#M79426</link>
      <description>&lt;P&gt;The issue is that it is not returning an error like it should. ISERROR(VALUE("2a")) should return TRUE but it returns FALSE. See the attached screenshots.&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is a small sample of the values in the column I am working with:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This column is a string column and the column I am creating is also a string column. I did some replace fucntions to remove blank spaces and "g" and "G" (because those are the most common units attached to the end of my numeric values).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 18:01:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Value-function-converting-string-to-number/m-p/2667892#M79426</guid>
      <dc:creator>aallman</dc:creator>
      <dc:date>2022-07-28T18:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Value() function converting string to number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Value-function-converting-string-to-number/m-p/2667934#M79429</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="418631" data-lia-user-login="aallman" class="lia-mention lia-mention-user"&gt;aallman&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please follow these steps&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Numbers = 
SELECTCOLUMNS (
    UNION (
        GENERATESERIES ( 0, 9, 1 ),
        { "." }
    ),
    "Digit",
    [Value]
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Value = 
VAR String = 'Table'[MyColumn]
VAR Length = LEN ( String )
VAR T1 = GENERATESERIES ( 1, Length, 1 )
VAR T2 = ADDCOLUMNS ( T1, "@Letter", MID ( String, [Value], 1 ) )
VAR T3 = FILTER ( T2, [@Letter] IN VALUES ( Numbers[Digit] ) )
RETURN
    VALUE ( CONCATENATEX ( T3, [@Letter],, [Value], ASC ) )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Jul 2022 18:21:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-Value-function-converting-string-to-number/m-p/2667934#M79429</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-28T18:21:35Z</dc:date>
    </item>
  </channel>
</rss>

