<?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: Total Sold Last 45 Days Since Last Sold Data  per Country in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2951546#M97881</link>
    <description>&lt;P&gt;The exercise is about creating a range of dates that go from the date of eachtot record - 45 days and add the total sales obtained within that range.&lt;/P&gt;&lt;P&gt;For example: Germany, which appears twice in screenshot, would have a total sales for the range between dates 12/03/2022 and 10/19/2022 (12/03/2022 - 45 days) and another total sales for the range between dates 11/13/2022 and 09/29/2022 (11/13/2022 - 45 days).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, the objective is not to take the maximum date and subtract 45 days. The objective is to take each of the dates and subtract the 45 days to obtain the total sales for each range.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 13:37:46 GMT</pubDate>
    <dc:creator>esgaranel</dc:creator>
    <dc:date>2022-12-06T13:37:46Z</dc:date>
    <item>
      <title>Total Sold Last 45 Days Since Last Sold Data  per Country</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2949405#M97717</link>
      <description>&lt;P&gt;Hello, I need help to calculate the total sold the last 45 days by country from each date record.&amp;nbsp;For example: Germany has a total from 12/03/2022 to 10/19/2022 (45 days) and another total from 11/13/2022 to 09/29/2022 (45 days). It is not so easy. Thanks.&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;LINK TO DOWNLOAD DATASET:&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/19jZC7b8IAwlKHWeQmYzDzLmLzxbHXvHJ/view?usp=share_link" target="_blank"&gt;https://drive.google.com/file/d/19jZC7b8IAwlKHWeQmYzDzLmLzxbHXvHJ/view?usp=share_link&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 20:31:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2949405#M97717</guid>
      <dc:creator>esgaranel</dc:creator>
      <dc:date>2022-12-05T20:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sold Last 45 Days Since Last Sold Data  per Country</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2949430#M97721</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="482084" data-lia-user-login="esgaranel" class="lia-mention lia-mention-user"&gt;esgaranel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have a date table? Can you provide more context about your data and data model?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 20:04:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2949430#M97721</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-05T20:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sold Last 45 Days Since Last Sold Data  per Country</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2949477#M97724</link>
      <description>&lt;P&gt;OK, thanks. I forgot it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LINK TO DOWNLOAD DATASET:&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/19jZC7b8IAwlKHWeQmYzDzLmLzxbHXvHJ/view?usp=share_link" target="_blank" rel="nofollow noopener noreferrer"&gt;https://drive.google.com/file/d/19jZC7b8IAwlKHWeQmYzDzLmLzxbHXvHJ/view?usp=share_link&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 20:32:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2949477#M97724</guid>
      <dc:creator>esgaranel</dc:creator>
      <dc:date>2022-12-05T20:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sold Last 45 Days Since Last Sold Data  per Country</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2949535#M97729</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="482084" data-lia-user-login="esgaranel" class="lia-mention lia-mention-user"&gt;esgaranel&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please refer to attached sample file with the solution&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Last 45 Days Sales = 
VAR LastSoldDate = [Last Sold Date]
RETURN
    CALCULATE ( 
        SUM ( 'DATASET'[Sales] ),
        DATESINPERIOD ( CalendaryTable[Date], LastSoldDate, - 45, DAY )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Dec 2022 21:11:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2949535#M97729</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-05T21:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sold Last 45 Days Since Last Sold Data  per Country</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2950964#M97819</link>
      <description>&lt;P&gt;Sorry, it is not correct. The result should be as indicated in the screenshots.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 09:36:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2950964#M97819</guid>
      <dc:creator>esgaranel</dc:creator>
      <dc:date>2022-12-06T09:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sold Last 45 Days Since Last Sold Data  per Country</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2951087#M97825</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="482084" data-lia-user-login="esgaranel" class="lia-mention lia-mention-user"&gt;esgaranel&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Actually I was confused with the negative sales values. Now I'm even more confused about the statement "&lt;EM&gt;Spain and Germany have two different total sales on two different dates&lt;/EM&gt;". What does that even mean?!! Which two date? Based on what?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 10:18:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2951087#M97825</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-06T10:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sold Last 45 Days Since Last Sold Data  per Country</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2951546#M97881</link>
      <description>&lt;P&gt;The exercise is about creating a range of dates that go from the date of eachtot record - 45 days and add the total sales obtained within that range.&lt;/P&gt;&lt;P&gt;For example: Germany, which appears twice in screenshot, would have a total sales for the range between dates 12/03/2022 and 10/19/2022 (12/03/2022 - 45 days) and another total sales for the range between dates 11/13/2022 and 09/29/2022 (11/13/2022 - 45 days).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, the objective is not to take the maximum date and subtract 45 days. The objective is to take each of the dates and subtract the 45 days to obtain the total sales for each range.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 13:37:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2951546#M97881</guid>
      <dc:creator>esgaranel</dc:creator>
      <dc:date>2022-12-06T13:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sold Last 45 Days Since Last Sold Data  per Country</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2956507#M98225</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="482084" data-lia-user-login="esgaranel" class="lia-mention lia-mention-user"&gt;esgaranel&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Apologies for the late resonse. Actually this is much more complex than you would think. The reason is that the slicing by column do not actually exist. However, I will try to do something, of course no guarantees.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have adoubt regarding negative sales. For example if I want to calculate the very last date with sales I guess I need to consider the dates which have SUM ( DATASET[Sales] ) &amp;gt; 0 is that correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also when you say: "&lt;SPAN&gt;&lt;EM&gt;For example: Germany has a total from 12/03/2022 to 10/19/2022 (45 days) and another total from 11/13/2022 to 09/29/2022 (45 days)&lt;/EM&gt;" How has the 11/13/2022 date been selected? Based on what?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 11:39:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2956507#M98225</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-08T11:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sold Last 45 Days Since Last Sold Data  per Country</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2957402#M98302</link>
      <description>&lt;P&gt;Hello, first of all thank you for the attention you are giving me.&lt;BR /&gt;1- Negative values are returns. You don't have to discriminate anything. SUM( DATASET[Sales] )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2-&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 17:40:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Sold-Last-45-Days-Since-Last-Sold-Data-per-Country/m-p/2957402#M98302</guid>
      <dc:creator>esgaranel</dc:creator>
      <dc:date>2022-12-08T17:40:45Z</dc:date>
    </item>
  </channel>
</rss>

