<?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: Converting other language text data to date type in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1342358#M24033</link>
    <description>&lt;P&gt;Solved this for Spanish with my poor-man's coding skills.&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;Date_Index = 
	IF(Pro_Report[entryConsoleType] = "DATE_YEAR", 
			IF(LEFT(Pro_Report[values],3) = "ene", COMBINEVALUES("-","jan", RIGHT(Pro_Report[values],7)),
            IF(LEFT(Pro_Report[values],3) = "abr", COMBINEVALUES("-","apr", RIGHT(Pro_Report[values],7)),
            IF(LEFT(Pro_Report[values],3) = "ago", COMBINEVALUES("-","aug", RIGHT(Pro_Report[values],7)),
            SUBSTITUTE(Pro_Report[values],".","")))), BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking into it there are only 3 months that cause issues. Jan, Apr, and Aug. The rest overlap with 3 letters. So I just find and replace those 3 months, combine with the last 7 digits (dd-yyyy), then strip out an periods from the remaining months. And that fixes it.....for Spanish. Will not work with Serbian/Ukraine (so far the only other non-english language here).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The real solution is to get the 3rd party BI to not record dates as &amp;lt;first 3 letter of month&amp;gt;-&amp;lt;dd&amp;gt;-&amp;lt;yyyy&amp;gt; and without ios locale stuff. I've got feature requests with that company on that issue. But the code here works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: I also wanted to add that I am specifically &lt;STRONG&gt;&lt;U&gt;not using Power Query&lt;/U&gt;&lt;/STRONG&gt; for a few performance reasons. So instead of using Transform Data to replace values, you can use the SUBSTITUTE command in DAX to accomplish the same thing.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Sep 2020 21:08:24 GMT</pubDate>
    <dc:creator>Ocean_PowerBI</dc:creator>
    <dc:date>2020-09-02T21:08:24Z</dc:date>
    <item>
      <title>Converting other language text data to date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1333010#M23649</link>
      <description>&lt;P&gt;I've got a unique problem that I have not seen anyone else run into. I'm pulling data from a 3rd party BI database and I am making a new date column from a data in a text column that contains more than date info with the following command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Date_Index = IF(Pro_Report[entryConsoleType] = "DATE_YEAR", Pro_Report[values], BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;This simply pulls the text data from the values column over to the Date_Index column (which is formatted as Date type) whenever the entryConsoleType is "DATE_YEAR". Which worked great until I ran into a unique issue. The data is gathered through a production app running on IOS that allows you to select a different language for the user. When the user selects Spanish, for some reason that changes how the dates are recorded in the text column and I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cannot convert value 'ago.-24-2020' of type Text to type Date.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It fails to recognise that "ago." is August or Agosto in spanish. This simple issue breaks everything. Is there anything that I can do to have it recognise these as actual dates? Is there any way I can recondition the text info?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 22:35:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1333010#M23649</guid>
      <dc:creator>Ocean_PowerBI</dc:creator>
      <dc:date>2020-08-28T22:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Converting other language text data to date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1333027#M23652</link>
      <description>&lt;P&gt;Oh, you're in for a whole bag of hurt.&amp;nbsp; Basically what you will need to do is create a lookup table with all possible date formats created by the iOS app, and then try them in some random order.&amp;nbsp; Good luck distinguishing "5/10/2020"&amp;nbsp; from a user in Brasil and a user in the US.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;BTW this has nothing at all to do with language. It's the locale setting that you need to be worried about.&amp;nbsp;Can you get the locale out of the iOS data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/Date_format_by_country" target="_blank" rel="noopener"&gt;https://en.wikipedia.org/wiki/Date_format_by_country&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 23:27:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1333027#M23652</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-08-28T23:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Converting other language text data to date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1339424#M23892</link>
      <description>&lt;P&gt;How about some baby steps. Is there a way I can edit the query to remove and periods ( . ) from the text string while transfering the value to the new column?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 20:25:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1339424#M23892</guid>
      <dc:creator>Ocean_PowerBI</dc:creator>
      <dc:date>2020-09-01T20:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Converting other language text data to date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1339441#M23893</link>
      <description>&lt;P&gt;Transform... Replace Values&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;</description>
      <pubDate>Tue, 01 Sep 2020 20:35:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1339441#M23893</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-09-01T20:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Converting other language text data to date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1342258#M24022</link>
      <description>&lt;P&gt;I don't believe I can blanket remove periods from the values column because it contains info that does also need a period. I'm only taking info from this column based on a value from another column. Am I able to bake in a substitute command into this query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Date_Index = IF(Pro_Report[entryConsoleType] = "DATE_YEAR", Pro_Report[values], BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So that after it does the logic it then strips the period from the value it is supposed to bring over? How would I wrap that in?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 19:55:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1342258#M24022</guid>
      <dc:creator>Ocean_PowerBI</dc:creator>
      <dc:date>2020-09-02T19:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Converting other language text data to date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1342275#M24023</link>
      <description>&lt;P&gt;Ok, so I was able to get rid of the period like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Date_Index = IF(Pro_Report[entryConsoleType] = "DATE_YEAR", SUBSTITUTE(Pro_Report[values],".",""), BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now If only there was a way to either convert locale to en-US or write another statement that replaces spanish abbreviations with english. Is there a better way than just looping in a bunch of IF satatements?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 20:02:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1342275#M24023</guid>
      <dc:creator>Ocean_PowerBI</dc:creator>
      <dc:date>2020-09-02T20:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Converting other language text data to date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1342283#M24024</link>
      <description>&lt;P&gt;Remember what I said about the bag of hurt?&amp;nbsp; Your only way to really solve this is via getting the locale information as part of your source data.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 20:05:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1342283#M24024</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-09-02T20:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Converting other language text data to date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1342358#M24033</link>
      <description>&lt;P&gt;Solved this for Spanish with my poor-man's coding skills.&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;Date_Index = 
	IF(Pro_Report[entryConsoleType] = "DATE_YEAR", 
			IF(LEFT(Pro_Report[values],3) = "ene", COMBINEVALUES("-","jan", RIGHT(Pro_Report[values],7)),
            IF(LEFT(Pro_Report[values],3) = "abr", COMBINEVALUES("-","apr", RIGHT(Pro_Report[values],7)),
            IF(LEFT(Pro_Report[values],3) = "ago", COMBINEVALUES("-","aug", RIGHT(Pro_Report[values],7)),
            SUBSTITUTE(Pro_Report[values],".","")))), BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking into it there are only 3 months that cause issues. Jan, Apr, and Aug. The rest overlap with 3 letters. So I just find and replace those 3 months, combine with the last 7 digits (dd-yyyy), then strip out an periods from the remaining months. And that fixes it.....for Spanish. Will not work with Serbian/Ukraine (so far the only other non-english language here).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The real solution is to get the 3rd party BI to not record dates as &amp;lt;first 3 letter of month&amp;gt;-&amp;lt;dd&amp;gt;-&amp;lt;yyyy&amp;gt; and without ios locale stuff. I've got feature requests with that company on that issue. But the code here works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: I also wanted to add that I am specifically &lt;STRONG&gt;&lt;U&gt;not using Power Query&lt;/U&gt;&lt;/STRONG&gt; for a few performance reasons. So instead of using Transform Data to replace values, you can use the SUBSTITUTE command in DAX to accomplish the same thing.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 21:08:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-other-language-text-data-to-date-type/m-p/1342358#M24033</guid>
      <dc:creator>Ocean_PowerBI</dc:creator>
      <dc:date>2020-09-02T21:08:24Z</dc:date>
    </item>
  </channel>
</rss>

