<?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 Query for Current Year vs Previous Year Weekly Sales in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Query-for-Current-Year-vs-Previous-Year-Weekly-Sales/m-p/3022597#M102910</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="465533" data-lia-user-login="anilpoda" class="lia-mention lia-mention-user"&gt;anilpoda&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1)&amp;nbsp; My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2) We can create two measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Current Year Weekly Sales =
CALCULATE (
    SUM ( Fact_OrderLines[Value] ),
    FILTER (
        ALL ( Fact_OrderLines ),
        YEAR ( [Order Date] ) = MAX ( 'Date'[Calendar Year] )
            &amp;amp;&amp;amp; WEEKNUM ( Fact_OrderLines[Order Date] ) = MAX ( 'Date'[Week No] )
    )
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Previous Year Weekly Sales =
CALCULATE (
    SUM ( Fact_OrderLines[Value] ),
    FILTER (
        ALL ( Fact_OrderLines ),
        YEAR ( [Order Date] )
            = MAX ( 'Date'[Calendar Year] ) - 1
            &amp;amp;&amp;amp; WEEKNUM ( Fact_OrderLines[Order Date] ) = MAX ( 'Date'[Week No] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;(3) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jan 2023 08:35:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-01-16T08:35:27Z</dc:date>
    <item>
      <title>DAX Query for Current Year vs Previous Year Weekly Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Query-for-Current-Year-vs-Previous-Year-Weekly-Sales/m-p/3021386#M102804</link>
      <description>&lt;P&gt;I am trying to create a table visualization with 3 columns&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Week No&lt;/P&gt;&lt;P&gt;2. Current Year Weekly Sales&lt;/P&gt;&lt;P&gt;3. Previous Year Weekly Sales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Date Table with Calendar Year and Week No Columns. Whenever I select an year in the dropdown filter I should see selected Year Week No, Selected Year weekly sales in one column and previous year weekly sales. Can anyone help me with the DAX query please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have the option to attach Pbix file. Kindly download the report I am working using below link&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Pbix File" href="https://drive.google.com/file/d/1Xn7ECMrzm-FZMP-ctOuWDC8wADT5_0pH/view?usp=sharing" target="_blank" rel="noopener"&gt;Download Pbix File&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 11:32:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Query-for-Current-Year-vs-Previous-Year-Weekly-Sales/m-p/3021386#M102804</guid>
      <dc:creator>anilpoda</dc:creator>
      <dc:date>2023-01-15T11:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Query for Current Year vs Previous Year Weekly Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Query-for-Current-Year-vs-Previous-Year-Weekly-Sales/m-p/3022597#M102910</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="465533" data-lia-user-login="anilpoda" class="lia-mention lia-mention-user"&gt;anilpoda&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1)&amp;nbsp; My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2) We can create two measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Current Year Weekly Sales =
CALCULATE (
    SUM ( Fact_OrderLines[Value] ),
    FILTER (
        ALL ( Fact_OrderLines ),
        YEAR ( [Order Date] ) = MAX ( 'Date'[Calendar Year] )
            &amp;amp;&amp;amp; WEEKNUM ( Fact_OrderLines[Order Date] ) = MAX ( 'Date'[Week No] )
    )
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Previous Year Weekly Sales =
CALCULATE (
    SUM ( Fact_OrderLines[Value] ),
    FILTER (
        ALL ( Fact_OrderLines ),
        YEAR ( [Order Date] )
            = MAX ( 'Date'[Calendar Year] ) - 1
            &amp;amp;&amp;amp; WEEKNUM ( Fact_OrderLines[Order Date] ) = MAX ( 'Date'[Week No] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;(3) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 08:35:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Query-for-Current-Year-vs-Previous-Year-Weekly-Sales/m-p/3022597#M102910</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-16T08:35:27Z</dc:date>
    </item>
  </channel>
</rss>

