<?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: MTD / QTD / YTD Dax not working for Last year calculations in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-QTD-YTD-Dax-not-working-for-Last-year-calculations/m-p/1193672#M18955</link>
    <description>&lt;P&gt;Thanks for that,&amp;nbsp; it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 01:50:29 GMT</pubDate>
    <dc:creator>arniet</dc:creator>
    <dc:date>2020-07-01T01:50:29Z</dc:date>
    <item>
      <title>MTD / QTD / YTD Dax not working for Last year calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-QTD-YTD-Dax-not-working-for-Last-year-calculations/m-p/1177761#M18304</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset that I am wanting to create the following metrics for:&lt;/P&gt;&lt;P&gt;Metrics:&lt;/P&gt;&lt;P&gt;========================&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Total Sales&lt;/LI&gt;&lt;LI&gt;Year to Date&lt;/LI&gt;&lt;LI&gt;Month to Date&lt;/LI&gt;&lt;LI&gt;Year on year Sales&lt;/LI&gt;&lt;LI&gt;Month on Month Sales&lt;/LI&gt;&lt;LI&gt;Order Date To Ship Date Average Time&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I have created measures for MTD / QTD and YTD for *this year* and it works fine. When I create it for *last year* I get a blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MTD Sales (This Year)($) = TOTALMTD(SUM(Sales_Fact[SalesAmount]),Sales_Fact[OrderDate])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MTD Sales (Last Year)($) = CALCULATE([MTD Sales (This Year)($)],DATEADD(Sales_Fact[OrderDate], -1, YEAR))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Am I using the correct date in my DAX? When do I use the date from the Date Dim table and when do I used the date from the Sales Fact table? This is where I might be going wrong. Please advise.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt; &lt;/P&gt;&lt;img /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please help as I have tried changing the format of the data, changed the data model etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Arnie.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 00:14:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-QTD-YTD-Dax-not-working-for-Last-year-calculations/m-p/1177761#M18304</guid>
      <dc:creator>arniet</dc:creator>
      <dc:date>2020-06-24T00:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: MTD / QTD / YTD Dax not working for Last year calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-QTD-YTD-Dax-not-working-for-Last-year-calculations/m-p/1177925#M18309</link>
      <description>&lt;P&gt;At the very minimum you need a calendar/dates table.&amp;nbsp; you cannot use your facts table for date math.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once the dates table is in place, have a look at the "quick measures"&amp;nbsp; templates in Power BI. They include MTD and more.&amp;nbsp; Also check &lt;A href="https://daxpatterns.com" target="_blank"&gt;https://daxpatterns.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 02:10:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-QTD-YTD-Dax-not-working-for-Last-year-calculations/m-p/1177925#M18309</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-24T02:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: MTD / QTD / YTD Dax not working for Last year calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-QTD-YTD-Dax-not-working-for-Last-year-calculations/m-p/1193672#M18955</link>
      <description>&lt;P&gt;Thanks for that,&amp;nbsp; it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 01:50:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-QTD-YTD-Dax-not-working-for-Last-year-calculations/m-p/1193672#M18955</guid>
      <dc:creator>arniet</dc:creator>
      <dc:date>2020-07-01T01:50:29Z</dc:date>
    </item>
  </channel>
</rss>

