<?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: Calculate previous fiscal year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/1578484#M31531</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="199625" data-lia-user-login="dannyd" class="lia-mention lia-mention-user"&gt;dannyd&lt;/a&gt; , You can get that with help from date table and time intelligence. &lt;/P&gt;
&lt;P&gt;replace 12/31 in case of datesytd with end of your year&lt;/P&gt;
&lt;P&gt;example&lt;/P&gt;
&lt;P&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))&lt;BR /&gt;Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))&lt;BR /&gt;This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))&lt;BR /&gt;Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))&lt;BR /&gt;Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))&lt;BR /&gt;Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//Only year vs Year, not a level below&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;BR /&gt;Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;BR /&gt;rolling = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]&amp;gt;=max('Date'[Year])-2 &amp;amp;&amp;amp; 'Date'[Year]&amp;lt;=max('Date'[Year])) )&lt;/P&gt;
&lt;P&gt;diff = [This Year]-[Last Year ]&lt;BR /&gt;diff % = divide([This Year]-[Last Year ],[Last Year ])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer Power BI — Year on Year with or Without Time Intelligence &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=km41KfM_0uA" target="_blank"&gt;https://www.youtube.com/watch?v=km41KfM_0uA&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jan 2021 01:41:21 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-01-04T01:41:21Z</dc:date>
    <item>
      <title>Calculate previous fiscal year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/1578237#M31516</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;I'm struggling to figure out how to calculate the spend for the previous fiscal year.&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;My current measure looks like this:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="markup"&gt;Spend Previous FY = CALCULATE(
      ([Spend Actual Current Month]),
      All('Date'), 'Date'[Fiscalyear] = YEAR(TODAY())-1
)&lt;/LI-CODE&gt;&lt;P&gt;The problem i'm having is that YEAR(TODAY) refers to the actual calendar and not the fiscal year calendar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tips on how to manage this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2021 15:58:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/1578237#M31516</guid>
      <dc:creator>dannyd</dc:creator>
      <dc:date>2021-01-03T15:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate previous fiscal year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/1578380#M31522</link>
      <description>&lt;P&gt;The easiest&amp;nbsp;approach is to use the inbuilt time intelligence formulas&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Spend Previous FY = CALCULATE(
      ([Spend Actual Current Month]),
      SAMEPERIODPRIORYEAR('DATE'[Date])
)&lt;/LI-CODE&gt;&lt;P&gt;this assumes your calendar table is at the day level and follows the calendar table rules&lt;/P&gt;&lt;P&gt;&lt;A href="https://exceleratorbi.com.au/power-pivot-calendar-tables/" target="_blank"&gt;https://exceleratorbi.com.au/power-pivot-calendar-tables/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;instead of using TODAY(), you use a slicer to select a date, and the formula will work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2021 21:11:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/1578380#M31522</guid>
      <dc:creator>MattAllington</dc:creator>
      <dc:date>2021-01-03T21:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate previous fiscal year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/1578484#M31531</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="199625" data-lia-user-login="dannyd" class="lia-mention lia-mention-user"&gt;dannyd&lt;/a&gt; , You can get that with help from date table and time intelligence. &lt;/P&gt;
&lt;P&gt;replace 12/31 in case of datesytd with end of your year&lt;/P&gt;
&lt;P&gt;example&lt;/P&gt;
&lt;P&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))&lt;BR /&gt;Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))&lt;BR /&gt;This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))&lt;BR /&gt;Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))&lt;BR /&gt;Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))&lt;BR /&gt;Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//Only year vs Year, not a level below&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;BR /&gt;Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;BR /&gt;rolling = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]&amp;gt;=max('Date'[Year])-2 &amp;amp;&amp;amp; 'Date'[Year]&amp;lt;=max('Date'[Year])) )&lt;/P&gt;
&lt;P&gt;diff = [This Year]-[Last Year ]&lt;BR /&gt;diff % = divide([This Year]-[Last Year ],[Last Year ])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer Power BI — Year on Year with or Without Time Intelligence &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=km41KfM_0uA" target="_blank"&gt;https://www.youtube.com/watch?v=km41KfM_0uA&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 01:41:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/1578484#M31531</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-01-04T01:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate previous fiscal year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/2365480#M60542</link>
      <description>&lt;P&gt;I'm having the same issue -&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;: your solution works but only at the year granularity. I need to be able to look at any period - year, quarter or month - to see the selected vs previous year values. Here are the results I'm getting:&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;The DAX is summarizing the previous year for every month, however I need to be able to use the custom date table's 445/fiscal calendar, which I'm struggling with. I attached a copy of the fiscal calendar for&amp;nbsp; few years in case you have any pointers.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I was able to successfully convert this calendar into a 445 calendar in power bi, and renamed the columns to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FiscalYear&lt;/P&gt;&lt;P&gt;FiscalQuarter&lt;/P&gt;&lt;P&gt;FiscalMonth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I use Dateadd to grab this fiscal year vs last fiscal year, it doesn't work, because actual dates of the fiscal year periods don't match up to one another, even though they have the same number of days in each.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example Fiscal Q1 in 2020 has the dates 2/2/2020-5/2/2020 however Fiscal Q1 in 2021 has the dates 1/31/2020-5/1/2021. I'm completed stuck!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 19:51:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/2365480#M60542</guid>
      <dc:creator>petelanglois</dc:creator>
      <dc:date>2022-02-28T19:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate previous fiscal year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/3512155#M134798</link>
      <description>&lt;P&gt;This was very helpful, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 13:50:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-previous-fiscal-year/m-p/3512155#M134798</guid>
      <dc:creator>Unknowncharacte</dc:creator>
      <dc:date>2023-11-02T13:50:41Z</dc:date>
    </item>
  </channel>
</rss>

