<?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 Difference from previous period (in YYYYMM format) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-from-previous-period-in-YYYYMM-format/m-p/1375768#M25093</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a column named PERIOD (in YYYYMM) format in both the fact and calendar tables.&lt;/P&gt;&lt;P&gt;Is there a way to calculate the difference between current period and previous period in the pivot?&lt;/P&gt;&lt;P&gt;Please see the screenshot below:&lt;/P&gt;&lt;P&gt;Difference between 201902 and 201901 should be 156,276 - 258,244 = (101968) and so on. I want to show the actual values and difference in columns (pivoted format).&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Sep 2020 17:28:17 GMT</pubDate>
    <dc:creator>chandakaushik</dc:creator>
    <dc:date>2020-09-16T17:28:17Z</dc:date>
    <item>
      <title>Difference from previous period (in YYYYMM format)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-from-previous-period-in-YYYYMM-format/m-p/1375768#M25093</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a column named PERIOD (in YYYYMM) format in both the fact and calendar tables.&lt;/P&gt;&lt;P&gt;Is there a way to calculate the difference between current period and previous period in the pivot?&lt;/P&gt;&lt;P&gt;Please see the screenshot below:&lt;/P&gt;&lt;P&gt;Difference between 201902 and 201901 should be 156,276 - 258,244 = (101968) and so on. I want to show the actual values and difference in columns (pivoted format).&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 17:28:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-from-previous-period-in-YYYYMM-format/m-p/1375768#M25093</guid>
      <dc:creator>chandakaushik</dc:creator>
      <dc:date>2020-09-16T17:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Difference from previous period (in YYYYMM format)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-from-previous-period-in-YYYYMM-format/m-p/1376005#M25100</link>
      <description>&lt;P&gt;Convert the period to a fake date&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATE(YYYY,MM,1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then tie that date into the calendar table. From there you can then use the regular time intelligence functions.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 20:15:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-from-previous-period-in-YYYYMM-format/m-p/1376005#M25100</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-09-16T20:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Difference from previous period (in YYYYMM format)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-from-previous-period-in-YYYYMM-format/m-p/1376448#M25111</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="170077" data-lia-user-login="chandakaushik" class="lia-mention lia-mention-user"&gt;chandakaushik&lt;/a&gt; , better is that you create a date , as suggested by &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;, and use a date calendar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And create measures like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
previous month value =  CALCULATE(sum(''Table''[total hours value]),previousmonth('Date'[Date]))

diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second way is to have month year table (Your month are sortable) and create a rank. You need to have a separate table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Month Rank = RANKX(all('Date'),'Date'[Month],,ASC,Dense)
This Month = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Month Rank]=max('Date'[Month Rank])))
Last Month = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Month Rank]=max('Date'[Month Rank])-1))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&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" rel="noopener"&gt;https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Appreciate your Kudos.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 02:20:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-from-previous-period-in-YYYYMM-format/m-p/1376448#M25111</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-09-17T02:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Difference from previous period (in YYYYMM format)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-from-previous-period-in-YYYYMM-format/m-p/1383721#M25287</link>
      <description>&lt;P&gt;Thank you guys,&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;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;! Appreciate your guidence and help!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 08:59:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-from-previous-period-in-YYYYMM-format/m-p/1383721#M25287</guid>
      <dc:creator>chandakaushik</dc:creator>
      <dc:date>2020-09-21T08:59:22Z</dc:date>
    </item>
  </channel>
</rss>

