<?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: Sum of Sales at a given point in time in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/3052201#M105182</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="451586" data-lia-user-login="Euro0681" class="lia-mention lia-mention-user"&gt;Euro0681&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;Table1：&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Table2：&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1.The two tables form the following relationship.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2.Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
SUMX(
   FILTER(ALL('Table1'),
   YEAR('Table1'[Date])=MAX('Table2'[Fiscal Year])),[Value])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure 2 =
SUMX(FILTER(ALL('Table2'),
'Table2'[Fiscal Year]=YEAR(TODAY())-1),[Measure])&lt;/LI-CODE&gt;
&lt;P&gt;The result is shown as below :&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Ailsa Tao&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jan 2023 09:24:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-01-31T09:24:44Z</dc:date>
    <item>
      <title>Sum of Sales at a given point in time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/2999085#M101184</link>
      <description>&lt;P&gt;Hey Everybody,&lt;BR /&gt;I'm wanting to calculate the sum of sales for a given year (Always the previous year), but I dont wan't this to be applied at a row by row basis.. For better clarification here's an example&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So to clarify in this example I have filtered the date to show the previous 3 years of data, and I want to create a measure that calculates the sum of sales for 2021. The reason for this is because I want to look at the MAX(Year) we have and give me the previous year of that.&lt;BR /&gt;&lt;BR /&gt;I want the measure to display like the table on the right, Not the table on the left. I have tried....&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Measure = Calculate( Sum('Table 1'[Sales]) , 'Table 2'[Fiscal Year] = MAXX( ALL('Table 2') , 'Table 2'[Fiscal Year] ) - 1 )&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;which would work but an issue I'm facing is that the tables have a visual Filter Applied to show the Last 3 years of data but in my&amp;nbsp; Date Table I have a range of 2020 - 2027 for fiscal year so in this case my measure only gives me Sum of sales for 2026 (Which returns blanks)&amp;nbsp;&lt;BR /&gt;So I Then tried...&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Measure = Calculate( Sum('Table 1'[Sales]) , 'Table 2'[Fiscal Year] = MAXX( ALLSELECTED('Table 2') , 'Table 2'[Fiscal Year] ) - 1 )&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;But this gives me the table on the left in the image and that's not the correct results can anyone help me out or have any suggestions??&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 16:58:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/2999085#M101184</guid>
      <dc:creator>Euro0681</dc:creator>
      <dc:date>2023-01-03T16:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Sales at a given point in time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/2999092#M101186</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="451586" data-lia-user-login="Euro0681" class="lia-mention lia-mention-user"&gt;Euro0681&lt;/a&gt; , Not very clear. How come all are 700?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a separate date table with distinct year and join that with year of this table. Use year from new table in slicer and visual&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example measure for this year vs last year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 17:06:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/2999092#M101186</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-01-03T17:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Sales at a given point in time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/2999099#M101187</link>
      <description>&lt;P&gt;All are 700 because the Maximum Year is 2022 so it'll minus 1 from 2022 and return sales for 2021 which are 300 + 400 return 700&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 17:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/2999099#M101187</guid>
      <dc:creator>Euro0681</dc:creator>
      <dc:date>2023-01-03T17:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Sales at a given point in time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/2999107#M101189</link>
      <description>&lt;P&gt;And also this table is using columns from 2 tables from the model (Date Dimension &amp;amp; Sales Fact), where there be a reason to create another date table?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 17:12:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/2999107#M101189</guid>
      <dc:creator>Euro0681</dc:creator>
      <dc:date>2023-01-03T17:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Sales at a given point in time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/2999276#M101206</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="451586" data-lia-user-login="Euro0681" class="lia-mention lia-mention-user"&gt;Euro0681&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;Measure2 =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( 'Table 1'[Sales] ),&lt;BR /&gt;'Table 2'[Fiscal Year]&lt;BR /&gt;= YEAR ( MAXX ( ALL ( 'Table 1' ), 'Table 1'[Date] ) ) - 1&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 18:49:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/2999276#M101206</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-01-03T18:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Sales at a given point in time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/3052201#M105182</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="451586" data-lia-user-login="Euro0681" class="lia-mention lia-mention-user"&gt;Euro0681&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;Table1：&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Table2：&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1.The two tables form the following relationship.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2.Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
SUMX(
   FILTER(ALL('Table1'),
   YEAR('Table1'[Date])=MAX('Table2'[Fiscal Year])),[Value])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure 2 =
SUMX(FILTER(ALL('Table2'),
'Table2'[Fiscal Year]=YEAR(TODAY())-1),[Measure])&lt;/LI-CODE&gt;
&lt;P&gt;The result is shown as below :&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Ailsa Tao&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 09:24:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Sales-at-a-given-point-in-time/m-p/3052201#M105182</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-31T09:24:44Z</dc:date>
    </item>
  </channel>
</rss>

