<?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 amount previous week (snapshot) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/139546#M262</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="23108" data-lia-user-login="kaushikd" class="lia-mention lia-mention-user"&gt;kaushikd&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already done it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The key is using the field DimDate.Date instead of Sales.Snapshot date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To calculate difference I have used phormula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Increase sales = CALCULATE(SUM('Planning registrado lunes'[Sales amount]) - CALCULATE(SUM('Planning registrado lunes'[Sales amount]);DATEADD(Calendario[Date];-7;DAY)) &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2017 10:52:41 GMT</pubDate>
    <dc:creator>Angel</dc:creator>
    <dc:date>2017-03-09T10:52:41Z</dc:date>
    <item>
      <title>Sales amount previous week (snapshot)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/136315#M246</link>
      <description>&lt;P&gt;Hi, everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can help me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I include the image to explain what I want to do.&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I would like to show how sales amount have been increased every month per week. To do that, I have tried to create a measure with this phormula.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;EM&gt;Sales amount last week = CALCULATE(SUM('Sales'[Sales amount]);FILTER(DimTable;DimTable[WeekCount]-1))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I include the measure in the table, the result is the same than Sales Amount current week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;img /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Does anyone know how can I do that?.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 11:21:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/136315#M246</guid>
      <dc:creator>Angel</dc:creator>
      <dc:date>2017-03-03T11:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sales amount previous week (snapshot)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/137830#M253</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 08:59:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/137830#M253</guid>
      <dc:creator>kaushikd</dc:creator>
      <dc:date>2017-03-07T08:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sales amount previous week (snapshot)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/137926#M254</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have used your sample data set and tried to find Sales amount for previous week&lt;/P&gt;&lt;P&gt;Please have a look into it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://app.powerbi.com/view?r=eyJrIjoiOGRjNDYyMmUtOWFhMy00ZGE3LThjMjQtNTA2NTFhZTE5ODViIiwidCI6ImJmNzM2NTcyLTk5OTgtNDM3NC05YjA4LTU3MzQ3NGE3MzNhYSIsImMiOjEwfQ%3D%3D" target="_blank"&gt;https://app.powerbi.com/view?r=eyJrIjoiOGRjNDYyMmUtOWFhMy00ZGE3LThjMjQtNTA2NTFhZTE5ODViIiwidCI6ImJmNzM2NTcyLTk5OTgtNDM3NC05YjA4LTU3MzQ3NGE3MzNhYSIsImMiOjEwfQ%3D%3D&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all you need to model up your data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Modelling Dataset&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;img /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Model your data into this format please check the &lt;STRONG&gt;Applied Steps&amp;nbsp;&lt;/STRONG&gt;for more information basicly Pivoting the salesid from column to row will help.If your data is in such format you can jump to the next step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Create a Date Dimension&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Go to &lt;STRONG&gt;Data&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;View&lt;/STRONG&gt; for modelling&lt;/P&gt;&lt;P&gt;Select &lt;STRONG&gt;Modelling&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Choose &lt;STRONG&gt;New Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;fire the DAX to create date dimension&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DateDim = CALENDAR (DATE (2016, 1, 1), DATE (2016, 12, 31))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Now Select New Column and fire DAX&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WeekNumber = WEEKNUM('DateDim'[Date].[Date])&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;to create weeknumber column into your date dimension.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Relationship&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Create a 1 to many Relationship Between your&amp;nbsp;&lt;STRONG&gt;Date Dim&amp;nbsp;&lt;/STRONG&gt;Dataset and &lt;STRONG&gt;PBI&lt;/STRONG&gt; on basis of&amp;nbsp;&lt;STRONG&gt;Date Dim[Date]=PBI[SnapshotDate]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Create Measure&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Right Click on&amp;nbsp;the &lt;STRONG&gt;DateDim&amp;nbsp;&lt;/STRONG&gt;Dataset and choose New Measure and Fire&amp;nbsp;this query&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sales Previous Week = CALCULATE(Sum(PBI[Sales]),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;FILTER(All('DateDim'), 'DateDim'[WeekNumber] = MIN('DateDim'[WeekNumber])-1 ))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now in &lt;STRONG&gt;Report View&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Drop a slicer and put&lt;STRONG&gt; WeekNumber&lt;/STRONG&gt; into the field&lt;/P&gt;&lt;P&gt;Now Drop a Chart and Put &lt;STRONG&gt;Sales&lt;/STRONG&gt; and the&amp;nbsp;&lt;STRONG&gt;Sales Previous Week &lt;/STRONG&gt;into the value Field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this fulfills&amp;nbsp;your requirement please like this post&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 11:18:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/137926#M254</guid>
      <dc:creator>kaushikd</dc:creator>
      <dc:date>2017-03-07T11:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sales amount previous week (snapshot)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/139514#M261</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="23108" data-lia-user-login="kaushikd" class="lia-mention lia-mention-user"&gt;kaushikd&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer. It's nearly works.. ;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works when I use WeekNumber in rows&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;However, when I include snapshot date in rows, data appears in different rows. ¿Is there any way to avoid it?.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Anyway, the thing I want to do is create a measure that shows how sales amount have been increased per week regard to month sales.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tip?.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 09:47:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/139514#M261</guid>
      <dc:creator>Angel</dc:creator>
      <dc:date>2017-03-09T09:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sales amount previous week (snapshot)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/139546#M262</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="23108" data-lia-user-login="kaushikd" class="lia-mention lia-mention-user"&gt;kaushikd&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already done it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The key is using the field DimDate.Date instead of Sales.Snapshot date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To calculate difference I have used phormula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Increase sales = CALCULATE(SUM('Planning registrado lunes'[Sales amount]) - CALCULATE(SUM('Planning registrado lunes'[Sales amount]);DATEADD(Calendario[Date];-7;DAY)) &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 10:52:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/139546#M262</guid>
      <dc:creator>Angel</dc:creator>
      <dc:date>2017-03-09T10:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sales amount previous week (snapshot)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/139693#M263</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="23108" data-lia-user-login="kaushikd" class="lia-mention lia-mention-user"&gt;kaushikd&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final thing I want to do is only shows sales where sales date &amp;gt; Last snapshot date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In this sample&amp;nbsp;it has only show sales where sales date &amp;gt;= 06/06/2016 in every snapshot date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know user can use slicers, but it could be great without user interaction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 15:17:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/139693#M263</guid>
      <dc:creator>Angel</dc:creator>
      <dc:date>2017-03-09T15:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sales amount previous week (snapshot)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/720304#M1380</link>
      <description>&lt;P&gt;If you use the code provided, wouldn't the MIN(WeekNumber) be 1 which effectively zeros out the week number you are filtering on?&lt;/P&gt;&lt;PRE&gt;Sales Previous Week = CALCULATE(Sum(PBI[Sales]),
FILTER(All('DateDim'), 'DateDim'[WeekNumber] = MIN('DateDim'[WeekNumber])-1 )) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 14:24:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-amount-previous-week-snapshot/m-p/720304#M1380</guid>
      <dc:creator>accortdr</dc:creator>
      <dc:date>2019-06-20T14:24:14Z</dc:date>
    </item>
  </channel>
</rss>

