<?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: LYTD (last year, month and day) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3747743#M146173</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="623734" data-lia-user-login="FR14" class="lia-mention lia-mention-user"&gt;FR14&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly.&lt;BR /&gt;Can you share sample data and the results you are hoping for? Show it as a screenshot or excel. Or a sample pbix after removing sensitive data. We can better understand the problem and help you.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Yulia Yan&lt;/P&gt;</description>
    <pubDate>Thu, 07 Mar 2024 05:13:47 GMT</pubDate>
    <dc:creator>v-weiyan1-msft</dc:creator>
    <dc:date>2024-03-07T05:13:47Z</dc:date>
    <item>
      <title>LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3744322#M146012</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What formula i can use to get same amount of orders last year, month and day? for example last year 06.03.2023 amount.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current formula is this but this but it doesn't work correctly as it shows me LYTD full month! and not up to 06.03.2023&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&l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PAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;__MaxDate&lt;/SPAN&gt;&lt;SPAN&gt; ))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you all very much for your help in advance!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 05 Mar 2024 22:35:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3744322#M146012</guid>
      <dc:creator>FR14</dc:creator>
      <dc:date>2024-03-05T22:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3744564#M146030</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="623734" data-lia-user-login="FR14" class="lia-mention lia-mention-user"&gt;FR14&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your description, here is the dummy data I created.&lt;BR /&gt;OrderLine:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Dates:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please try code as below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LY YTD Bookings = 
VAR _MaxDate = MAX(Dates[Date])
VAR _PreviousYear = YEAR(_MaxDate) - 1
RETURN
CALCULATE(
    SUM(OrderLine[Booking USD]),
    YEAR(OrderLine[Open_Date]) = _PreviousYear,
    MONTH(OrderLine[Open_Date]) &amp;lt;= MONTH(_MaxDate),
    DAY(OrderLine[Open_Date]) &amp;lt;= DAY(_MaxDate)
)
&lt;/LI-CODE&gt;
&lt;P&gt;Or you can also consider using the following code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous YTD = 
CALCULATE (
    SUM ( 'OrderLine'[Booking USD] ),
    DATESYTD ( DATEADD ( 'OrderLine'[Open_Date], -1, YEAR ) )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expect?&lt;BR /&gt;Please correct me if I misunderstood your needs.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Yulia Yan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 02:10:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3744564#M146030</guid>
      <dc:creator>v-weiyan1-msft</dc:creator>
      <dc:date>2024-03-06T02:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3744691#M146037</link>
      <description>&lt;P&gt;&amp;nbsp;SAMEPERIODLASTYEAR combined with an EDATE(xxx,-12) limiter is the safest bet.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 03:01:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3744691#M146037</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-06T03:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3746479#M146114</link>
      <description>&lt;P&gt;Thank you for the idea! would be able please to help me put this in my formula? i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;(&lt;/SPAN&gt;&lt;SPAN&gt;'OrderLine'&lt;/SPAN&gt;&lt;SPAN&gt;[Open_Date]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;__MaxDate&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;))&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Mar 2024 15:24:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3746479#M146114</guid>
      <dc:creator>FR14</dc:creator>
      <dc:date>2024-03-06T15:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3746484#M146115</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 15:26:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3746484#M146115</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-06T15:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3746486#M146116</link>
      <description>&lt;P&gt;Thank you so much for the efforts to support! i tried first method but when i leave the filter on default (all months) it doesn't work correctly. I want this to be able to show LYTD totals and then when i select March it only shows March values. Do you think there is anyway to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 15:27:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3746486#M146116</guid>
      <dc:creator>FR14</dc:creator>
      <dc:date>2024-03-06T15:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3746530#M146123</link>
      <description>&lt;P&gt;Unfortunately i cannot provide sample data as it's senstive, do you think you could tell me approx where to put this in my formula to get LYTD specifc month amounts?&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;LY YTD Bookings=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;__MaxDate&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Dates&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;OrderLine&lt;/SPAN&gt;&lt;SPAN&gt;[Booking USD]&lt;/SPAN&gt;&lt;SPAN&gt;),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'OrderLine'&lt;/SPAN&gt;&lt;SPAN&gt;[Open_Date]&lt;/SPAN&gt;&lt;SPAN&gt;) =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;__MaxDate&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'OrderLine'&lt;/SPAN&gt;&lt;SPAN&gt;[Open_Date]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;__MaxDate&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;))&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Mar 2024 15:49:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3746530#M146123</guid>
      <dc:creator>FR14</dc:creator>
      <dc:date>2024-03-06T15:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3746537#M146125</link>
      <description>&lt;P&gt;Sorry, I cannot assist without meaningful sample data.&amp;nbsp;I hope someone else can help you further.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 15:51:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3746537#M146125</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-06T15:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3747692#M146167</link>
      <description>&lt;P&gt;Everything works okay for the month total but for complete LYTD total it doesn't add up correct and total is wrong:( do you know how we can solve this?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 04:45:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3747692#M146167</guid>
      <dc:creator>FR14</dc:creator>
      <dc:date>2024-03-07T04:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3747743#M146173</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="623734" data-lia-user-login="FR14" class="lia-mention lia-mention-user"&gt;FR14&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly.&lt;BR /&gt;Can you share sample data and the results you are hoping for? Show it as a screenshot or excel. Or a sample pbix after removing sensitive data. We can better understand the problem and help you.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Yulia Yan&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 05:13:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3747743#M146173</guid>
      <dc:creator>v-weiyan1-msft</dc:creator>
      <dc:date>2024-03-07T05:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: LYTD (last year, month and day)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3747752#M146175</link>
      <description>&lt;P&gt;Your first method works correctly to have exact value for LYTD March, Jan &amp;amp; Feb but when i check the total LYTD Jan,Feb &amp;amp; March the total doesn't sum up correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 05:20:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LYTD-last-year-month-and-day/m-p/3747752#M146175</guid>
      <dc:creator>FR14</dc:creator>
      <dc:date>2024-03-07T05:20:00Z</dc:date>
    </item>
  </channel>
</rss>

