<?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 Cumulative DAX to compare two financial years in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-DAX-to-compare-two-financial-years/m-p/1433853#M26750</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to plot two lines on a “Line and clustered column chart”. I would like one line to display the cumulative margin % of last financial year (1/10/2019 – 30/09/2020). And the second line to display this Financial year (1/10/2020 – today).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried the following DAX thinking it might automatically split into two line (which is does if I choose a “Line chart” &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cumulative Margin % YOY = CALCULATE(SUM(Sheet[Margin (filtered)])/sum(Sheet[Total Sell]),FILTER(ALLSELECTED(Dates[Date]),Dates[Date] &amp;lt;= max (Dates[Date])),VALUES(Dates[Fiscal Year]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However using this DAX in the a “Line and clustered column chart” only creates one line with the wrong values.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So I think I need to create two separate measures – one for FY19 and one for this FY – my issue is I’m struggling to create a cumulative DAX that will only cover the period (1/10/2019 – 30/09/2020). This is the DAX I am using currently&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cumulative Margin % = CALCULATE(SUM(Sheet[Margin (filtered)])/sum(Sheet[Total Sell]),&lt;/P&gt;&lt;P&gt;FILTER(ALLSELECTED(Dates[Date]),Dates[Date] &amp;lt;= max (Dates[Date])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;Any help would be appreciated &lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Oct 2020 16:35:27 GMT</pubDate>
    <dc:creator>JamesGordon</dc:creator>
    <dc:date>2020-10-14T16:35:27Z</dc:date>
    <item>
      <title>Cumulative DAX to compare two financial years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-DAX-to-compare-two-financial-years/m-p/1433853#M26750</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to plot two lines on a “Line and clustered column chart”. I would like one line to display the cumulative margin % of last financial year (1/10/2019 – 30/09/2020). And the second line to display this Financial year (1/10/2020 – today).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried the following DAX thinking it might automatically split into two line (which is does if I choose a “Line chart” &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cumulative Margin % YOY = CALCULATE(SUM(Sheet[Margin (filtered)])/sum(Sheet[Total Sell]),FILTER(ALLSELECTED(Dates[Date]),Dates[Date] &amp;lt;= max (Dates[Date])),VALUES(Dates[Fiscal Year]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However using this DAX in the a “Line and clustered column chart” only creates one line with the wrong values.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So I think I need to create two separate measures – one for FY19 and one for this FY – my issue is I’m struggling to create a cumulative DAX that will only cover the period (1/10/2019 – 30/09/2020). This is the DAX I am using currently&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cumulative Margin % = CALCULATE(SUM(Sheet[Margin (filtered)])/sum(Sheet[Total Sell]),&lt;/P&gt;&lt;P&gt;FILTER(ALLSELECTED(Dates[Date]),Dates[Date] &amp;lt;= max (Dates[Date])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;Any help would be appreciated &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 16:35:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-DAX-to-compare-two-financial-years/m-p/1433853#M26750</guid>
      <dc:creator>JamesGordon</dc:creator>
      <dc:date>2020-10-14T16:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative DAX to compare two financial years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-DAX-to-compare-two-financial-years/m-p/1434569#M26776</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="208944" data-lia-user-login="JamesGordon" class="lia-mention lia-mention-user"&gt;JamesGordon&lt;/a&gt; , if you want cumulative on Year on Year, we can use datesytd like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Margin % = divide(SUM(Sheet[Margin (filtered)]),sum(Sheet[Total Sell]))

YTD Sales = CALCULATE([Margin %],DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE([Margin %],DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE([Margin %],DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE([Margin %],DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE([Margin %],DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE([Margin %],dateadd('Date'[Date],-1,Year))
//Only year vs Year, not a level below

This Year = CALCULATE([Margin %],filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE([Margin %],filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

diff = [This Year]-[Last Year ]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only Cumm&lt;/P&gt;
&lt;P&gt;Cumm Sales = CALCULATE([Margin %],filter(allselected(date),date[date] &amp;lt;=max(date[date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1"&gt; Please provide your feedback comments and advice for new videos &lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=wvsAzTqSDVg&amp;amp;list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb" target="_blank"&gt;Tutorial Series&lt;/A&gt; &lt;A href="https://www.youtube.com/watch?v=WlvQ_SGy4iA&amp;amp;list=PLPaNVDMhUXGZNyKU0PgG2g3P0c6CPjMnj" target="_blank"&gt;Dax Vs SQL&lt;/A&gt; &lt;A href="https://www.youtube.com/watch?v=My0bLn9voo4&amp;amp;list=PLPaNVDMhUXGbKatyDdOhGbTL3xW2Xy6pA" target="_blank"&gt;Direct Query&lt;/A&gt; &lt;A href="https://www.youtube.com/watch?v=YWo-ZpKM6gU&amp;amp;list=PLPaNVDMhUXGYrm5rm6ME6rjzKGSvT9Jmy" target="_blank"&gt;PBI Tips&lt;/A&gt; &lt;BR /&gt;Appreciate your Kudos.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 01:48:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-DAX-to-compare-two-financial-years/m-p/1434569#M26776</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-10-15T01:48:54Z</dc:date>
    </item>
  </channel>
</rss>

