<?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 percentage from year before in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-from-year-before/m-p/1230516#M20060</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="246654" data-lia-user-login="rolfvp" class="lia-mention lia-mention-user"&gt;rolfvp&lt;/a&gt; , really not clear. But if you are looking for YOY comparison, refer my blog&lt;/P&gt;
&lt;P&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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
//Only year vs Year, not a level below

This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;BR /&gt;&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions&lt;/A&gt; &lt;BR /&gt;&lt;A href="https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi" target="_blank"&gt;https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;See if my webinar on Time Intelligence can help: &lt;A href="https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184" target="_blank"&gt;https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Appreciate your Kudos.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jul 2020 09:11:55 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-07-17T09:11:55Z</dc:date>
    <item>
      <title>Calculate percentage from year before</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-from-year-before/m-p/1230465#M20059</link>
      <description>&lt;P&gt;I would like to have a maesure like this (the % column) How an i do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me?&lt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lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 17 Jul 2020 08:50:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-from-year-before/m-p/1230465#M20059</guid>
      <dc:creator>rolfvp</dc:creator>
      <dc:date>2020-07-17T08:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate percentage from year before</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-from-year-before/m-p/1230516#M20060</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="246654" data-lia-user-login="rolfvp" class="lia-mention lia-mention-user"&gt;rolfvp&lt;/a&gt; , really not clear. But if you are looking for YOY comparison, refer my blog&lt;/P&gt;
&lt;P&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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
//Only year vs Year, not a level below

This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;BR /&gt;&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions&lt;/A&gt; &lt;BR /&gt;&lt;A href="https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi" target="_blank"&gt;https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;See if my webinar on Time Intelligence can help: &lt;A href="https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184" target="_blank"&gt;https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Appreciate your Kudos.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 09:11:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-from-year-before/m-p/1230516#M20060</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-17T09:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate percentage from year before</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-from-year-before/m-p/1230543#M20063</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="246654" data-lia-user-login="rolfvp" class="lia-mention lia-mention-user"&gt;rolfvp&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not very clear as to what is need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to have a Calendar Table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank" rel="noopener"&gt;https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sales Amount = SUMX ( Sales, Sales[Quantity] * Sales[Net Price])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sales Amount LY = CALCULATE(Sales[Sales Amount], SAMEPERIODLASTYEAR('Date'[Date]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sales Growth vs LY = DIVIDE( [Sales Amount] - [Sales LY],[Sales LY],BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/P&gt;&lt;P&gt;Did I answer your question? Mark my post as a solution!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 09:25:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-from-year-before/m-p/1230543#M20063</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-17T09:25:27Z</dc:date>
    </item>
  </channel>
</rss>

