<?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 Problem with cannot convert text into date type in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cannot-convert-text-into-date-type/m-p/3309999#M123691</link>
    <description>&lt;P&gt;I have a table [example] like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;submit_date&lt;/TD&gt;&lt;TD&gt;close_date&lt;/TD&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;04/01/2022&lt;/TD&gt;&lt;TD&gt;08/01/2022&lt;/TD&gt;&lt;TD&gt;A123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;05/06/2023&lt;/TD&gt;&lt;TD&gt;14/07/2023&lt;/TD&gt;&lt;TD&gt;A124&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and my dax code to return the table which have date differences:&lt;/P&gt;&lt;P&gt;TABLE =&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR table =&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUMMARIZE('example', [ID])&lt;/P&gt;&lt;P&gt;RETURN&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GENERATE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; table,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR tableId = 'example'[ID]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR SubDate = LOOKUPVALUE('example'[submit_date], 'example'[ID], [ID], 'example'[submit_date], "submitted_date")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR SubDateCalc = DATEVALUE(SubDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR CloseDate = LOOKUPVALUE('example'[tclose_date], 'example'[ID], [ID], 'example'[close_date], "closed_date")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR CloseDateCalc = DATEVALUE(CloseDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, while run this Dax command, having error with VAR SubDateCalc and VAR CloseDateCalc.&lt;/P&gt;&lt;P&gt;It keep giving me error that cannot convert text into date value..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone know the solution? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jun 2023 10:57:11 GMT</pubDate>
    <dc:creator>heejinyune</dc:creator>
    <dc:date>2023-06-30T10:57:11Z</dc:date>
    <item>
      <title>Problem with cannot convert text into date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cannot-convert-text-into-date-type/m-p/3309999#M123691</link>
      <description>&lt;P&gt;I have a table [example] like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;submit_date&lt;/TD&gt;&lt;TD&gt;close_date&lt;/TD&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;04/01/2022&lt;/TD&gt;&lt;TD&gt;08/01/2022&lt;/TD&gt;&lt;TD&gt;A123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;05/06/2023&lt;/TD&gt;&lt;TD&gt;14/07/2023&lt;/TD&gt;&lt;TD&gt;A124&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and my dax code to return the table which have date differences:&lt;/P&gt;&lt;P&gt;TABLE =&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR table =&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUMMARIZE('example', [ID])&lt;/P&gt;&lt;P&gt;RETURN&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GENERATE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; table,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR tableId = 'example'[ID]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR SubDate = LOOKUPVALUE('example'[submit_date], 'example'[ID], [ID], 'example'[submit_date], "submitted_date")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR SubDateCalc = DATEVALUE(SubDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR CloseDate = LOOKUPVALUE('example'[tclose_date], 'example'[ID], [ID], 'example'[close_date], "closed_date")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR CloseDateCalc = DATEVALUE(CloseDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, while run this Dax command, having error with VAR SubDateCalc and VAR CloseDateCalc.&lt;/P&gt;&lt;P&gt;It keep giving me error that cannot convert text into date value..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone know the solution? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2023 10:57:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cannot-convert-text-into-date-type/m-p/3309999#M123691</guid>
      <dc:creator>heejinyune</dc:creator>
      <dc:date>2023-06-30T10:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cannot convert text into date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cannot-convert-text-into-date-type/m-p/3310075#M123698</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="462277" data-lia-user-login="heejinyune" class="lia-mention lia-mention-user"&gt;heejinyune&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;The easier place to reliably convert date as text to date as date-datatype is in Power Query using the "with locale" type conversion.&lt;BR /&gt;In DAX you can replace all occurrences of&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DATEVALUE ( 'Table'[Date Text] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DATE ( 
    VALUE ( RIGHT ( 'Table'[Date Text], 4 ) ), 
    VALUE ( LEFT ( RIGHT ( 'Table'[Date Text], 7 ), 2 ) ), 
    VALUE ( LEFT ( 'Table'[Date Text], 2 ) ) 
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The behavior of DATEVALUE depends on the Culture property of your dataset, so some users might have the same problem and some not. With my de-de culture there was no problem as you described. Anyway, with the code above you are an the save side, as long as your data format is always two digits day,two digits month,4 digits year.&lt;/P&gt;&lt;P class="lia-align-right"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-right"&gt;&lt;A title="GitHub" href="https://github.com/MartinBubenheimer" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;A title="linkedin" href="https://www.linkedin.com/in/martin-bubenheimer-9ba99271/" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2023 11:33:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cannot-convert-text-into-date-type/m-p/3310075#M123698</guid>
      <dc:creator>Martin_D</dc:creator>
      <dc:date>2023-06-30T11:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cannot convert text into date type</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cannot-convert-text-into-date-type/m-p/3311845#M123838</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="462277" data-lia-user-login="heejinyune" class="lia-mention lia-mention-user"&gt;heejinyune&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There are several reasons why you might be getting an error that says "cannot convert text into date value" in Power BI Desktop when using DAX. One possible reason is that the DATE object is getting transformed into a DATETIME in Power BI&lt;/SPAN&gt;&lt;SPAN&gt;. Another possible reason is that the regional settings in Power BI Desktop are incorrect&lt;/SPAN&gt;&lt;SPAN&gt;. To resolve this issue, you can try changing the regional settings in Power BI Desktop to your country/region&lt;/SPAN&gt;&lt;SPAN&gt;. Please refer to&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.myonlinetraininghub.com/change-type-using-locale-with-power-query" target="_self"&gt;Change Type Using Locale with Power Query&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.youtube.com/watch?v=QKgS3hrrmvw" target="_blank"&gt;Power Query Change Type Using Locale - YouTube&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Stephen Tao&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 03:05:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cannot-convert-text-into-date-type/m-p/3311845#M123838</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-03T03:05:23Z</dc:date>
    </item>
  </channel>
</rss>

