<?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 Dynamic last December previous year with DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1353847#M24418</link>
    <description>&lt;P&gt;I'm rather new with the DAX formulas and I had a bit of trouble to resolve this issue in SSAS Tabular recently. I did solve it but I am wondering if it was the right way to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My customer wanted a measure that would show the outcome of their projects. The measure should show the outcome from the project start date to December 31 &lt;STRONG&gt;PREVIOUS&lt;/STRONG&gt; year. And it had to be dynamic since we don't know what year last December is. The customer wanted a pivot table in Excel to show the measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried a lot of DAX-date formulas but I didn't get it to work. But eventually I ended up with the following solution: I created a hidden measure called "&lt;STRONG&gt;LastPeriodPreviousYear&lt;/STRONG&gt;" and it looked like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; LastPeriodPreviousYear:= LASTDATE(PREVIOUSYEAR(Period[Month_Date]))&lt;/LI-CODE&gt;&lt;P&gt;Then I created a new measure that used &lt;STRONG&gt;LastPeriodPreviousYear&lt;/STRONG&gt;, and it look like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Outcome PTD last year:= CALCULATE ( SUM ( MOD001[Amount] ); DATESBETWEEN ( Period[Month_Date]; BLANK (); [LastPeriodPreviousYear] ) )&lt;/LI-CODE&gt;&lt;P&gt;These two calculations gave me the result that I wanted, and the customer is satisfied. But! I am curious and I want to learn. Is there a simpler/better/more good looking way to solve this matter? Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2020 07:09:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-08T07:09:19Z</dc:date>
    <item>
      <title>Dynamic last December previous year with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1353847#M24418</link>
      <description>&lt;P&gt;I'm rather new with the DAX formulas and I had a bit of trouble to resolve this issue in SSAS Tabular recently. I did solve it but I am wondering if it was the right way to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My customer wanted a measure that would show the outcome of their projects. The measure should show the outcome from the project start date to December 31 &lt;STRONG&gt;PREVIOUS&lt;/STRONG&gt; year. And it had to be dynamic since we don't know what year last December is. The customer wanted a pivot table in Excel to show the measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried a lot of DAX-date formulas but I didn't get it to work. But eventually I ended up with the following solution: I created a hidden measure called "&lt;STRONG&gt;LastPeriodPreviousYear&lt;/STRONG&gt;" and it looked like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; LastPeriodPreviousYear:= LASTDATE(PREVIOUSYEAR(Period[Month_Date]))&lt;/LI-CODE&gt;&lt;P&gt;Then I created a new measure that used &lt;STRONG&gt;LastPeriodPreviousYear&lt;/STRONG&gt;, and it look like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Outcome PTD last year:= CALCULATE ( SUM ( MOD001[Amount] ); DATESBETWEEN ( Period[Month_Date]; BLANK (); [LastPeriodPreviousYear] ) )&lt;/LI-CODE&gt;&lt;P&gt;These two calculations gave me the result that I wanted, and the customer is satisfied. But! I am curious and I want to learn. Is there a simpler/better/more good looking way to solve this matter? Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 07:09:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1353847#M24418</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-08T07:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic last December previous year with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1353933#M24421</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , You get in the following way last year-end date for standard calendar &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;last year end date = Date(year(today()),12,31)&lt;BR /&gt;&lt;BR /&gt;last year end date = Date(year(today()),12,31)&lt;BR /&gt;&lt;BR /&gt;last year end date = Date(year(eomonth(Period[Month_Date],0)),12,31)&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 07:36:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1353933#M24421</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-09-08T07:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic last December previous year with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1355690#M24491</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;That's a decent solution using Time "Intelligence". If you ever need a non-TI solution, you may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 17:09:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1355690#M24491</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-08T17:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic last December previous year with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1364177#M24724</link>
      <description>&lt;P&gt;&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;Thanks for your reply. I've tried to use those formulas but I ended up with this error: "&lt;EM&gt;Error: Calculation error in measure 'MOD001'[Testa]: A single value for column 'Month_Date' in table 'Period' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;Do you have any thoughts about this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;/Peps&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 11:17:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1364177#M24724</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-11T11:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic last December previous year with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1364194#M24726</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;Think you nailed your description of the DAX Time intelligence!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 11:22:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1364194#M24726</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-11T11:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic last December previous year with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1365378#M24771</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;- The error you are getting seems to indicate that you need to wrap any column references you have in the formula with an aggregation like MAX, MIN, etc.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 18:32:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1365378#M24771</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-11T18:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic last December previous year with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1370191#M24948</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;Thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been looking in to that, and I don't think that it's about MIN, MAX stuff, but rather that my time-dimension is a bit wrong. We don't have any real dates, just a month-date like 2020-09-01 and that's september. And the next month-date is 2020-10-01, so there is no real&amp;nbsp;regularity to our dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or mayby that the formula needs a more specific date or something? Do you have any thoughts about that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sorry for the lack of information, but as I said from the beginning, I'm a newbie at DAX (don't really get it, it's a **bleep**ty kind of language....) and I'm not great at Excel for that matter so I have a bit of trouble understanding how it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But thank you for taking the time mate!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 21:45:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1370191#M24948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-14T21:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic last December previous year with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1370278#M24954</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;The error you are getting indicates that a table of values is being returned when it expects a scalar. This means you are missing an aggregation somewhere. Easiest way to get around that many times is just wrap you column reference in an aggregation like MAX.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 23:21:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1370278#M24954</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-14T23:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic last December previous year with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1405735#M25941</link>
      <description>&lt;P&gt;Have been trying some options, and I thank you for you input.&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;I gave it shot, but it didn't really work. How ever, this seemed to work:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LastPeriodPreviousYear:= Date(year(MAX(Period[Month_Date]),0)-1,12,31) &lt;/LI-CODE&gt;&lt;P&gt;Thank you so much for your input&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; and&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 19:54:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-last-December-previous-year-with-DAX/m-p/1405735#M25941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-30T19:54:47Z</dc:date>
    </item>
  </channel>
</rss>

