<?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: Change date by time in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3154081#M113076</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you may try&lt;/P&gt;
&lt;P&gt;New Date =&lt;BR /&gt;DATEVALUE (&lt;BR /&gt;'Table'[2nd Weight Date] + 'Table'[2nd Weight Time]&lt;BR /&gt;- TIME ( 6, 0, 0 )&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Sat, 25 Mar 2023 20:36:22 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-03-25T20:36:22Z</dc:date>
    <item>
      <title>Change date by time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3153964#M113068</link>
      <description>&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two columns "Date" and "Time". I need to add a third column with the date "New Date".&lt;BR /&gt;The date should change not at 00:00 but at 06:00.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;BR /&gt;Weighing date March 1, 2023, time 11:39, "New date" March 1, 2023&lt;BR /&gt;Weighing date March 2, 2023, time 04:56, "New date" March 1, 2023&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;Thank you in advance for your cooperation.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 18:06:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3153964#M113068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-25T18:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Change date by time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3154033#M113073</link>
      <description>&lt;P&gt;I believe I understand this as for any times before 6am, the new date column should show the previous date, for times of 6am or later it should show the 2nd Weight date. Because this is a static property of the 2nd weight, and the 6am changeover time doesn't change, I suggest doing this in PowerQuery.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an expression to do this with a custom column in PowerQuery:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if Time.Hour([2nd Weight Time]) &amp;gt;= 6 then [2nd Weight Date] else Date.AddDays([2nd Weight Date], -1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the equivalent in DAX for a calculated column, but this would be less performant, so try the above first:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;New Date = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;IF(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; HOUR([2nd Weight Time]) &amp;lt; 6, &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; 'Weight Date and Times'[2nd Weight Date] - 1, &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; 'Weight Date and Times'[2nd Weight Date]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 25 Mar 2023 18:58:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3154033#M113073</guid>
      <dc:creator>andrewpirie</dc:creator>
      <dc:date>2023-03-25T18:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Change date by time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3154081#M113076</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you may try&lt;/P&gt;
&lt;P&gt;New Date =&lt;BR /&gt;DATEVALUE (&lt;BR /&gt;'Table'[2nd Weight Date] + 'Table'[2nd Weight Time]&lt;BR /&gt;- TIME ( 6, 0, 0 )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 20:36:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3154081#M113076</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-25T20:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change date by time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3154137#M113077</link>
      <description>&lt;P&gt;Thanks a lot, but I tried this way and it's not workig.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 22:47:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3154137#M113077</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-25T22:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Change date by time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3154138#M113078</link>
      <description>&lt;P&gt;Thanks a lot for help, now it's working.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 22:48:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-date-by-time/m-p/3154138#M113078</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-25T22:48:22Z</dc:date>
    </item>
  </channel>
</rss>

