<?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: Convert Timestamp into date-time in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3643395#M141069</link>
    <description>&lt;P&gt;Well, you have two different formats of date in your data then. here's the updated DAX to handle both formats.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DateTime_Converted =&lt;BR /&gt;VAR textDateTime = datetimesample[datetime]&lt;BR /&gt;VAR containsTime = CONTAINSSTRING(textDateTime, "@")&lt;BR /&gt;VAR cleanedDateTime = SUBSTITUTE(SUBSTITUTE(textDateTime, "@ ", ""), ",", "")&lt;BR /&gt;VAR datePart = IF(containsTime, LEFT(cleanedDateTime, LEN(cleanedDateTime) - 12), cleanedDateTime)&lt;BR /&gt;VAR timePartWithMilliseconds = IF(containsTime, RIGHT(cleanedDateTime, 12), "00:00:00")&lt;BR /&gt;VAR timePart = IF(containsTime, LEFT(timePartWithMilliseconds, 8), timePartWithMilliseconds) // Extracting only the HH:MM:SS part or default to 00:00:00 if no time part&lt;BR /&gt;RETURN&lt;BR /&gt;DATEVALUE(datePart) + TIMEVALUE(timePart)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2024 11:08:09 GMT</pubDate>
    <dc:creator>amustafa</dc:creator>
    <dc:date>2024-01-17T11:08:09Z</dc:date>
    <item>
      <title>Convert Timestamp into date-time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3641250#M140969</link>
      <description>&lt;P&gt;Goodday,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a CSV file withe a data-time field witch has the format (Jan 12, 2024 @ 19:39:03.793).&lt;/P&gt;&lt;P&gt;Is there a way to convert this format to a DD-MM-YYYY, HH:MM:SS&amp;nbsp; with a dax code?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 14:48:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3641250#M140969</guid>
      <dc:creator>Roost1969</dc:creator>
      <dc:date>2024-01-16T14:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Timestamp into date-time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3641366#M140973</link>
      <description>&lt;P&gt;Try this. Adjust the table and column name accordingly. This formula assumes that your original column is in text format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DateTime_Converted =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;textDateTime&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;datetimesample&lt;/SPAN&gt;&lt;SPAN&gt;[datetime]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;cleanedDateTime&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SUBSTITUTE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUBSTITUTE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;textDateTime&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"@ "&lt;/SPAN&gt;&lt;SP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&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;8&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;// Extracting only the HH:MM:SS part&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DATEVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;datePart&lt;/SPAN&gt;&lt;SPAN&gt;) + &lt;/SPAN&gt;&lt;SPAN&gt;TIMEVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;timePart&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 16 Jan 2024 15:52:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3641366#M140973</guid>
      <dc:creator>amustafa</dc:creator>
      <dc:date>2024-01-16T15:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Timestamp into date-time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3643167#M141059</link>
      <description>&lt;P&gt;thank you, de Time convert part works fine, but the Date part has a issue.&amp;nbsp; It says"Connot convert value 'Oct 31 2023' of type text to type Date.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 09:37:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3643167#M141059</guid>
      <dc:creator>Roost1969</dc:creator>
      <dc:date>2024-01-17T09:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Timestamp into date-time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3643395#M141069</link>
      <description>&lt;P&gt;Well, you have two different formats of date in your data then. here's the updated DAX to handle both formats.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DateTime_Converted =&lt;BR /&gt;VAR textDateTime = datetimesample[datetime]&lt;BR /&gt;VAR containsTime = CONTAINSSTRING(textDateTime, "@")&lt;BR /&gt;VAR cleanedDateTime = SUBSTITUTE(SUBSTITUTE(textDateTime, "@ ", ""), ",", "")&lt;BR /&gt;VAR datePart = IF(containsTime, LEFT(cleanedDateTime, LEN(cleanedDateTime) - 12), cleanedDateTime)&lt;BR /&gt;VAR timePartWithMilliseconds = IF(containsTime, RIGHT(cleanedDateTime, 12), "00:00:00")&lt;BR /&gt;VAR timePart = IF(containsTime, LEFT(timePartWithMilliseconds, 8), timePartWithMilliseconds) // Extracting only the HH:MM:SS part or default to 00:00:00 if no time part&lt;BR /&gt;RETURN&lt;BR /&gt;DATEVALUE(datePart) + TIMEVALUE(timePart)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 11:08:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3643395#M141069</guid>
      <dc:creator>amustafa</dc:creator>
      <dc:date>2024-01-17T11:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Timestamp into date-time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3645128#M141136</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Unfortunately this code doesn't work either, maybe I can send you a PBix?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 06:50:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3645128#M141136</guid>
      <dc:creator>Roost1969</dc:creator>
      <dc:date>2024-01-18T06:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Timestamp into date-time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3645575#M141156</link>
      <description>&lt;P&gt;Sure, that will help&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 09:54:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3645575#M141156</guid>
      <dc:creator>amustafa</dc:creator>
      <dc:date>2024-01-18T09:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Timestamp into date-time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3647595#M141272</link>
      <description>&lt;P&gt;After a import of a new dataset, the dataconvert works.&lt;/P&gt;&lt;P&gt;Thanks you for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 08:10:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-Timestamp-into-date-time/m-p/3647595#M141272</guid>
      <dc:creator>Roost1969</dc:creator>
      <dc:date>2024-01-19T08:10:38Z</dc:date>
    </item>
  </channel>
</rss>

