<?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: Newbie 1st Question - Moving Annual Trend in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761325#M36840</link>
    <description>&lt;P&gt;After playing around with the model, your post helped identify the problem.&lt;/P&gt;&lt;P&gt;Star Schema was being used AND the Dates table was marked.&lt;/P&gt;&lt;P&gt;The key to finding the problem was &lt;STRONG&gt;&lt;EM&gt;"Slicing and dicing is allowed only through dimensions."&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The ERROR was the date slicer which was NOT using the date field from the Dates table!&amp;nbsp; It was using the date field per the fact table.&amp;nbsp; Switching the date field filter (to the dates table version) fixed the issue.&amp;nbsp; Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Apr 2021 09:14:22 GMT</pubDate>
    <dc:creator>Lucky71</dc:creator>
    <dc:date>2021-04-02T09:14:22Z</dc:date>
    <item>
      <title>Newbie 1st Question - Moving Annual Trend</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1760651#M36816</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I'm new to DAX.&amp;nbsp; I'm trying to work it myself, but I'm totally stuck on this one!&amp;nbsp;&lt;/P&gt;&lt;P&gt;My basic MAT DAX formula works with simple data, ie Date &amp;amp; Amt:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MAT =&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SUM ( FactData[Amt]), &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATESINPERIOD(&lt;SPAN&gt;Dates[Date],&amp;nbsp;&lt;/SPAN&gt;LASTDATE ( Dates[Date] ), -1, YEAR&lt;SPAN&gt;)&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But when I add &lt;FONT color="#FF0000"&gt;&lt;EM&gt;Rep&lt;/EM&gt; &lt;/FONT&gt;into my data, the formula no longer works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;date&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;Rep&lt;/EM&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;Amt&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2015&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;28/02/2015&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 375&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2015&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 208&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;28/02/2015&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 966&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After adding &lt;FONT color="#FF0000"&gt;Rep&lt;/FONT&gt;, the MAT formula simply returns the monthly figure instead of the Moving annual trend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can somebody &lt;STRONG&gt;&lt;EM&gt;please&lt;/EM&gt; &lt;/STRONG&gt;help?&amp;nbsp; I've spent far too long trying to figure this out myself&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":weary_face:"&gt;😩&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 00:25:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1760651#M36816</guid>
      <dc:creator>Lucky71</dc:creator>
      <dc:date>2021-04-02T00:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie 1st Question - Moving Annual Trend</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1760669#M36818</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="294085" data-lia-user-login="Lucky71" class="lia-mention lia-mention-user"&gt;Lucky71&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula works and works the way it should. It just obeys all the filters that you put on your dimensions. If you want to ignore some dimensions or attributes, then you have to instruct your DAX to do it. Whatever Rep is, if it filters the fact table, the filter is honored when your measure is calculating the aggregation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without more information about your model it's not possible to tell you more.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 01:14:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1760669#M36818</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-04-02T01:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie 1st Question - Moving Annual Trend</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1760677#M36821</link>
      <description>&lt;P&gt;When I filter the data, eg 2016 only, the MAT only work for Dec16, because it is excluding pre 2016 data which is required for Jan-Nov16 MAT values.&amp;nbsp; How do I amend the formula below to calculate all 2016 monthly MATs correctly, e.g Jun 16 MAT = Jul15 to Jun2016 = 14,118.61, not 6,036.23!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAT = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUM ( FactData[Amt]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATESINPERIOD ( FactData[Date], LASTDATE ( FactData[Date] ), -1, YEAR )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I thought I could just add &lt;STRONG&gt;ALL(FactData[Date])&lt;/STRONG&gt;, but I could not get that to work.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 02 Apr 2021 01:33:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1760677#M36821</guid>
      <dc:creator>Lucky71</dc:creator>
      <dc:date>2021-04-02T01:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie 1st Question - Moving Annual Trend</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761215#M36831</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="294085" data-lia-user-login="Lucky71" class="lia-mention lia-mention-user"&gt;Lucky71&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the time-intel functions to work correctly you have to mark your Dates table as a date table in the model. Have you done it? If not, then right-click the table in the Fields pane and MARK IT AS A DATE TABLE. Then come back and tell us if it's worked. &lt;STRONG&gt;I'm 1000000% sure you have not marked the table&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 08:14:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761215#M36831</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-04-02T08:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie 1st Question - Moving Annual Trend</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761222#M36832</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="294085" data-lia-user-login="Lucky71" class="lia-mention lia-mention-user"&gt;Lucky71&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, time-intel functions will &lt;STRONG&gt;NOT&lt;/STRONG&gt; work with columns from fact tables. Don't even try as you have above... Columns in fact tables should be all &lt;STRONG&gt;HIDDEN&lt;/STRONG&gt;. Slicing and dicing is allowed only through dimensions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please read this:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/star-schema" target="_blank"&gt;Understand star schema and the importance for Power BI - Power BI | Microsoft Docs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 08:17:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761222#M36832</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-04-02T08:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie 1st Question - Moving Annual Trend</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761267#M36834</link>
      <description>&lt;P&gt;Star Schema being used AND&amp;nbsp;Dates Table already marked as Date table.&amp;nbsp; See below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 08:45:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761267#M36834</guid>
      <dc:creator>Lucky71</dc:creator>
      <dc:date>2021-04-02T08:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie 1st Question - Moving Annual Trend</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761325#M36840</link>
      <description>&lt;P&gt;After playing around with the model, your post helped identify the problem.&lt;/P&gt;&lt;P&gt;Star Schema was being used AND the Dates table was marked.&lt;/P&gt;&lt;P&gt;The key to finding the problem was &lt;STRONG&gt;&lt;EM&gt;"Slicing and dicing is allowed only through dimensions."&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The ERROR was the date slicer which was NOT using the date field from the Dates table!&amp;nbsp; It was using the date field per the fact table.&amp;nbsp; Switching the date field filter (to the dates table version) fixed the issue.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 09:14:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761325#M36840</guid>
      <dc:creator>Lucky71</dc:creator>
      <dc:date>2021-04-02T09:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie 1st Question - Moving Annual Trend</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761379#M36846</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="294085" data-lia-user-login="Lucky71" class="lia-mention lia-mention-user"&gt;Lucky71&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Great you were able to resolve your issue but please remember that if you leave columns of your fact table accessible to the user from the UI of your report, &lt;STRONG&gt;you are asking for trouble.&amp;nbsp;&lt;/STRONG&gt;Fact table should always be hidden and only dimensions exposed. A good design is one where fact tables consist only of keys to dimensions and figures (facts) that are aggregated by measures. The one and only exception to the rule above is a degenerate dimension (which must live in the fact table) but it's very rare. If you don't follow this golden rule of dimensional modeling in PBI.... well, you'll be sorry sooner or later. You've been warned.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 09:36:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-1st-Question-Moving-Annual-Trend/m-p/1761379#M36846</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-02T09:36:22Z</dc:date>
    </item>
  </channel>
</rss>

