<?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: Sales for the last and first selected period in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/960413#M11202</link>
    <description>&lt;P&gt;Hey, the Date or Calendar Table is very usefull for Time Intelligence calculation. First I suggested something that doesn't need it, but now I really don't understand what you mean with "Last Period".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume I have a selection from 1-1-2020 to 3-1-2020. There area three months there.&lt;/P&gt;
&lt;P&gt;Which are the Last period and the first period?&lt;/P&gt;
&lt;P&gt;Knowing this might help us to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 11:49:56 GMT</pubDate>
    <dc:creator>ibarrau</dc:creator>
    <dc:date>2020-03-05T11:49:56Z</dc:date>
    <item>
      <title>Sales for the last and first selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/955946#M10964</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have a excel source with data such as&lt;BR /&gt;Sale Date, product name, product type, quantity.&lt;BR /&gt;&lt;BR /&gt;On my report page I am showing the sales trend over the period of date using a stacked bar chart which is easy.&lt;BR /&gt;&lt;BR /&gt;My page has a slicer for the sales date by which user can choose the first date and last date to show the sales trend.&lt;BR /&gt;&lt;BR /&gt;On the same page I want show a card which will display the total sales for each product name, product type for the last selected period in the slicer and also the first selected period in the slicer.&lt;BR /&gt;&lt;BR /&gt;Can you please help?&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 02 Mar 2020 21:31:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/955946#M10964</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-02T21:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sales for the last and first selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/956313#M10972</link>
      <description>&lt;P&gt;Hello Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Orders (First Date) = 
CALCULATE (
    SUM ( Orders[Order Quantity] ),
    FILTER ( Orders, Orders[Order Date] = MIN ( Orders[Order Date] ) )
)

Total Orders (Last Date) = 
CALCULATE (
    SUM ( Orders[Order Quantity] ),
    FILTER ( Orders, Orders[Order Date] = MAX ( Orders[Order Date] ) )
)&lt;/LI-CODE&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;Cheers!&lt;BR /&gt;Vivek&lt;BR /&gt;&lt;BR /&gt;If it helps, please mark it as a solution&lt;BR /&gt;Kudos would be a cherry on the top &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.vivran.in/" target="_blank"&gt;https://www.vivran.in/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/vivek-ranjan-063a1a17b/" target="_blank"&gt;Connect on LinkedIn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 05:43:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/956313#M10972</guid>
      <dc:creator>vivran22</dc:creator>
      <dc:date>2020-03-03T05:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sales for the last and first selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/956443#M10981</link>
      <description>Thanks for response but please note I have tried this but it won’t work.&lt;BR /&gt;What the measure will return is the sales for the last period of product type/category.&lt;BR /&gt;&lt;BR /&gt;For example - the last sales period for product category A was DEC 2019 and for B it was Jan 2020. And the max date selected on the date slicer is 31Jan2020.&lt;BR /&gt;I expect the measure to display the sales of product B only and for A it should be blank as we’ve had no sales in jan 2020.&lt;BR /&gt;But the dax returns sales of product A in jan 2020 and sales of product B for dec 2019.&lt;BR /&gt;&lt;BR /&gt;Hope this helps</description>
      <pubDate>Tue, 03 Mar 2020 07:11:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/956443#M10981</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-03T07:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sales for the last and first selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/956830#M11012</link>
      <description>&lt;P&gt;Hi. It sound a bit tricky. Let me see if can get it. Then you need two measures. One for the first period and other for the last. The periods are complete months.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Orders (First Date) = 
CALCULATE (
    SUM ( Orders[Order Quantity] ),
    FILTER ( ALL(Orders[Order Date]), 
        Orders[Order Date] &amp;lt;= EOMONTH( MIN ( Orders[Order Date] ) ; 0)  
    )
)

Total Orders (Last Date) = 
CALCULATE (
    SUM ( Orders[Order Quantity] ),
    FILTER ( ALL(Orders[Order Date]), 
        Orders[Order Date] &amp;gt; EOMONTH( MAX ( Orders[Order Date] ) ; -1)  
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;With this you can compare the last month and the first month consider in the slicer for the orders.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this works.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 11:36:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/956830#M11012</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-03-03T11:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sales for the last and first selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/957039#M11026</link>
      <description>Do you have a proper Date table in the model? Or you're using the Order Date from the fact table in the slicer?&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Tue, 03 Mar 2020 14:23:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/957039#M11026</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-03T14:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sales for the last and first selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/960399#M11199</link>
      <description>Unfortunately this is not working as it returns all sales until the last selected period but I want to display only sales for the last selected period.</description>
      <pubDate>Thu, 05 Mar 2020 11:38:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/960399#M11199</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-05T11:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sales for the last and first selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/960402#M11200</link>
      <description>I am not using a date table for this. Would it be easier if I used a date table?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 05 Mar 2020 11:41:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/960402#M11200</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-05T11:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sales for the last and first selected period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/960413#M11202</link>
      <description>&lt;P&gt;Hey, the Date or Calendar Table is very usefull for Time Intelligence calculation. First I suggested something that doesn't need it, but now I really don't understand what you mean with "Last Period".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume I have a selection from 1-1-2020 to 3-1-2020. There area three months there.&lt;/P&gt;
&lt;P&gt;Which are the Last period and the first period?&lt;/P&gt;
&lt;P&gt;Knowing this might help us to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 11:49:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-for-the-last-and-first-selected-period/m-p/960413#M11202</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-03-05T11:49:56Z</dc:date>
    </item>
  </channel>
</rss>

