<?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: DAX Measure returning previous week sales by time range in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-returning-previous-week-sales-by-time-range/m-p/1731661#M35889</link>
    <description>&lt;P&gt;@ amitchandak&lt;/P&gt;&lt;P&gt;Thanks for your prompt reply. The formula seems working pretty well except there is some small difference in terms of amount and I must understand why.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, as it is at least a good step towards the solution, I'm happy to accept it as a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quick question (otherwise I might raise another ticket to the Community): If I only want last week sales for same time as today (eg. between midnight and now) - instead than the WTD as per above formula - what should I change it to make it working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2021 03:18:17 GMT</pubDate>
    <dc:creator>Weatherreport</dc:creator>
    <dc:date>2021-03-19T03:18:17Z</dc:date>
    <item>
      <title>DAX Measure returning previous week sales by time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-returning-previous-week-sales-by-time-range/m-p/1724005#M35674</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some sales data with date/time as per below sample:&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;I would like to build a DAX measure that would return previous week (to date) sales between 4am and NOW.&lt;/P&gt;&lt;P&gt;In other words, as our business week starts on Tuesday and ends on Monday, let's say that if today is Wednesday 17/03 3:39pm, I would need a formula that returns sales between Tue 9/03 4am and Wed 10/03 3:39 pm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it makes sense but happy to provide a better explanation if required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for helping.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 04:42:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-returning-previous-week-sales-by-time-range/m-p/1724005#M35674</guid>
      <dc:creator>Weatherreport</dc:creator>
      <dc:date>2021-03-16T04:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure returning previous week sales by time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-returning-previous-week-sales-by-time-range/m-p/1724133#M35681</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="287326" data-lia-user-login="Weatherreport" class="lia-mention lia-mention-user"&gt;Weatherreport&lt;/a&gt; , Last tueday will be &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last Tuesday = (Today() +-1*WEEKDAY(Today(),2)+1) -6&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you can trya measure like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From last tuesday =&lt;BR /&gt;var _last =(Today() +-1*WEEKDAY(Today(),2)+1) -6 + time(hour(now()), minute(now()), second(Now()))&lt;BR /&gt;var _now = now() &lt;BR /&gt;return &lt;BR /&gt;calculate(sum(Table[Value]), filter(Table, Table[Datetime] &amp;gt;=_last &amp;amp;&amp;amp; Table[Datetime] &amp;lt;=_now))&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 06:14:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-returning-previous-week-sales-by-time-range/m-p/1724133#M35681</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-03-16T06:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure returning previous week sales by time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-returning-previous-week-sales-by-time-range/m-p/1731661#M35889</link>
      <description>&lt;P&gt;@ amitchandak&lt;/P&gt;&lt;P&gt;Thanks for your prompt reply. The formula seems working pretty well except there is some small difference in terms of amount and I must understand why.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, as it is at least a good step towards the solution, I'm happy to accept it as a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quick question (otherwise I might raise another ticket to the Community): If I only want last week sales for same time as today (eg. between midnight and now) - instead than the WTD as per above formula - what should I change it to make it working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 03:18:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-returning-previous-week-sales-by-time-range/m-p/1731661#M35889</guid>
      <dc:creator>Weatherreport</dc:creator>
      <dc:date>2021-03-19T03:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure returning previous week sales by time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-returning-previous-week-sales-by-time-range/m-p/1731665#M35890</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;Sorry maybe I hadn't tagged you properly before&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 03:22:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-returning-previous-week-sales-by-time-range/m-p/1731665#M35890</guid>
      <dc:creator>Weatherreport</dc:creator>
      <dc:date>2021-03-19T03:22:41Z</dc:date>
    </item>
  </channel>
</rss>

