<?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 I in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I/m-p/1391435#M25519</link>
    <description>&lt;P&gt;I have monthly data on a set of KPIs, and want to create a table that gives the value of each KPI for the latest period as well as the value in the previous period (last month).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KPI&amp;nbsp; &amp;nbsp; &amp;nbsp;AsOF&amp;nbsp; Value&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8/31&amp;nbsp; &amp;nbsp; 99&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7/31&amp;nbsp; &amp;nbsp;88&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8/31&amp;nbsp; &amp;nbsp; 2.5&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7/31&amp;nbsp; &amp;nbsp; 2.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the output table to look like this&lt;/P&gt;&lt;P&gt;KPI&amp;nbsp; &amp;nbsp; &amp;nbsp; Current MOnth&amp;nbsp; &amp;nbsp; &amp;nbsp;Prev Month&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;99&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 88&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a measure for Current Month&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;calculate(sum(Data[Value]),filter(Data,Data[As Of]=max(Data[As Of])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;this works fine.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am unable to figure out the measure for previous month. Max - 1 works, but that will obviously fail in January and when the data spans multiple years.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Sep 2020 23:53:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-23T23:53:00Z</dc:date>
    <item>
      <title>I</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I/m-p/1391435#M25519</link>
      <description>&lt;P&gt;I have monthly data on a set of KPIs, and want to create a table that gives the value of each KPI for the latest period as well as the value in the previous period (last month).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KPI&amp;nbsp; &amp;nbsp; &amp;nbsp;AsOF&amp;nbsp; Value&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8/31&amp;nbsp; &amp;nbsp; 99&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7/31&amp;nbsp; &amp;nbsp;88&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8/31&amp;nbsp; &amp;nbsp; 2.5&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7/31&amp;nbsp; &amp;nbsp; 2.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the output table to look like this&lt;/P&gt;&lt;P&gt;KPI&amp;nbsp; &amp;nbsp; &amp;nbsp; Current MOnth&amp;nbsp; &amp;nbsp; &amp;nbsp;Prev Month&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;99&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 88&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a measure for Current Month&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;calculate(sum(Data[Value]),filter(Data,Data[As Of]=max(Data[As Of])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;this works fine.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am unable to figure out the measure for previous month. Max - 1 works, but that will obviously fail in January and when the data spans multiple years.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 23:53:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I/m-p/1391435#M25519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-23T23:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: I</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I/m-p/1391723#M25522</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Create a date table join it with AsOF&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try measures like&lt;/P&gt;
&lt;P&gt;MTD = CALCULATE(SUM(Table[Value]),DATESMTD('Date'[Date]))&lt;BR /&gt;last MTD = CALCULATE(SUM(Table[Value]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))&lt;BR /&gt;last month = CALCULATE(SUM(Table[Value]),previousmonth('Date'[Date]))&lt;BR /&gt;this month = CALCULATE(SUM(Table[Value]),DATESMTD(ENDOFMONTH('Date'[Date])))&lt;BR /&gt;last MTD (complete) = CALCULATE(SUM(Table[Value]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))&lt;BR /&gt;previous month value = CALCULATE(sum(''Table''[total hours value]),previousmonth('Date'[Date]))&lt;/P&gt;
&lt;P&gt;diff = [MTD]-[last MTD]&lt;BR /&gt;diff % = divide([MTD]-[last MTD],[last MTD])&lt;/P&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"&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;BR /&gt;Appreciate your Kudos.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 02:48:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I/m-p/1391723#M25522</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-09-24T02:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: I</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I/m-p/1395786#M25616</link>
      <description>&lt;P&gt;Thanks so much. This didnt exactly solve my problem, but much more importantly led me to a better understanding of date dimensions in DAX and how to think about the data model itself. I have made the monthly measures work with some reworking of the data tables, with one remaining challenge that is coming from the fact that some of my facts are captured monthly, some quarterly, and when I use a QTD, the months get summed for the monthly facts as well. Is there a way to suppress the calculation for the metrics that are monthly?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am using&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;cq = CALCULATE(SUM(facts[For Period]),DATESQTD(ENDOFQUARTER(Dates[Date])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I dont want to calculate / show cq for fact1 and fact2.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Sep 2020 12:47:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I/m-p/1395786#M25616</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-25T12:47:00Z</dc:date>
    </item>
  </channel>
</rss>

