<?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: Last year sales is not matching when compared in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2513907#M69809</link>
    <description>&lt;P&gt;I suspect this is to do with getting a date period shifted back 1 year but what you really want is to subtract one from the Fiscal year filter.&amp;nbsp; There will be differences of a few days which shows as a difference in the table .&lt;/P&gt;
&lt;P&gt;So rewrite the measure without sameperiodlastyear but&amp;nbsp; subtracting 1 from the fiscal year&lt;/P&gt;</description>
    <pubDate>Fri, 13 May 2022 15:22:23 GMT</pubDate>
    <dc:creator>HotChilli</dc:creator>
    <dc:date>2022-05-13T15:22:23Z</dc:date>
    <item>
      <title>Last year sales is not matching when compared</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2513611#M69793</link>
      <description>&lt;P&gt;Hello, I was comparing total sales of this year vs last year. But look at the picture, In 2011, &lt;STRONG&gt;the last year sales is not matching with 2010&lt;/STRONG&gt;. This is my dax formula&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;sales LY = CALCULATE( [Total Sales], SAMEPERIODLASTYEAR(DimDate[Date]))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;What's the problem actually?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 13:29:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2513611#M69793</guid>
      <dc:creator>Alex_Hasan</dc:creator>
      <dc:date>2022-05-13T13:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Last year sales is not matching when compared</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2513907#M69809</link>
      <description>&lt;P&gt;I suspect this is to do with getting a date period shifted back 1 year but what you really want is to subtract one from the Fiscal year filter.&amp;nbsp; There will be differences of a few days which shows as a difference in the table .&lt;/P&gt;
&lt;P&gt;So rewrite the measure without sameperiodlastyear but&amp;nbsp; subtracting 1 from the fiscal year&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 15:22:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2513907#M69809</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2022-05-13T15:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Last year sales is not matching when compared</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2513977#M69811</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="81111" data-lia-user-login="HotChilli" class="lia-mention lia-mention-user"&gt;HotChilli&lt;/a&gt;&amp;nbsp;, thanks for your response. This is the result showing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 15:39:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2513977#M69811</guid>
      <dc:creator>Alex_Hasan</dc:creator>
      <dc:date>2022-05-13T15:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Last year sales is not matching when compared</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2514009#M69812</link>
      <description>&lt;P&gt;I was trying to give the algorithm rather than explicit directions for the measure.&lt;/P&gt;
&lt;P&gt;Filter arguments are of the form :&amp;nbsp; &amp;nbsp;column = some value (which uses an aggregation).&lt;/P&gt;
&lt;P&gt;You have part of the solution but not all of it.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 15:51:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2514009#M69812</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2022-05-13T15:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Last year sales is not matching when compared</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2514118#M69828</link>
      <description>&lt;P&gt;I disagree with your assessment.&amp;nbsp; I'm not going to write it for you but I'm trying to give you encouragement.&lt;/P&gt;
&lt;P&gt;See my previous post for hint.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 16:52:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2514118#M69828</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2022-05-13T16:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Last year sales is not matching when compared</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2514201#M69837</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;Was that the right file (I think you might have deleted it now)?&lt;BR /&gt;Anyway, try this&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Sales PreviousYear = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Total Sales]&lt;/SPAN&gt;&lt;SPAN&gt; , &lt;/SPAN&gt;&lt;SPAN&gt;DimDate[FiscalYear]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimDate[FiscalYear]&lt;/SPAN&gt;&lt;SPAN&gt;) -&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 May 2022 17:35:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2514201#M69837</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2022-05-13T17:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Last year sales is not matching when compared</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2514220#M69843</link>
      <description>&lt;P&gt;Yeah, I have deleted it. I found the problem. I mistakenly chose Fiscal Year instead of Calender year (I could not notice it). Now everything is all right with the &lt;SPAN&gt;sales LY = CALCULATE( [Total Sales], SAMEPERIODLASTYEAR(DimDate[Date]))&amp;nbsp; formula.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Your last code didn't work actually. But I am grateful to you because you tried to help me a lot. Thank you so much.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 17:46:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-sales-is-not-matching-when-compared/m-p/2514220#M69843</guid>
      <dc:creator>Alex_Hasan</dc:creator>
      <dc:date>2022-05-13T17:46:06Z</dc:date>
    </item>
  </channel>
</rss>

