<?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: Last year week based on day name in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-week-based-on-day-name/m-p/808040#M5067</link>
    <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried using the DATESYTD function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of&amp;nbsp;&lt;SPAN&gt;DATEADD('TableDates [Date]'[date]; -1; YEAR), you can use:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATESYTD ( 'TableDates [Date]'[Date] )&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;More info:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/datesytd-function-dax" target="_blank"&gt;https://docs.microsoft.com/en-us/dax/datesytd-function-dax&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, your table naming ('TableDates [Date]') is quite confusing as it has square brackets which are normally used for column notation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Alex&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2019 14:14:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-10-02T14:14:38Z</dc:date>
    <item>
      <title>Last year week based on day name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-week-based-on-day-name/m-p/807912#M5061</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help with a dax function for last year data. I am using this function to calculate, for example, the revenue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Revenue = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var calc =&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(table[revenue]);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;USERELATIONSHIP('TableDates [Date]'[date];table[date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&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;IF(calculo = BLANK() ; 0; calculo)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Revenue last year = &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;[Revenue];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATEADD('TableDates [Date]'[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;When I am drilling down from month to week, the information of week last year is not the same (by month and days is working perfectly). That's because the seven days of the week 201829 are not the same in 201929LY. How can I modify the fuction to get the same number?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TableDates:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Error in the graph:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Oct 2019 09:39:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-week-based-on-day-name/m-p/807912#M5061</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-03T09:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Last year week based on day name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-week-based-on-day-name/m-p/808040#M5067</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried using the DATESYTD function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of&amp;nbsp;&lt;SPAN&gt;DATEADD('TableDates [Date]'[date]; -1; YEAR), you can use:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATESYTD ( 'TableDates [Date]'[Date] )&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;More info:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/datesytd-function-dax" target="_blank"&gt;https://docs.microsoft.com/en-us/dax/datesytd-function-dax&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, your table naming ('TableDates [Date]') is quite confusing as it has square brackets which are normally used for column notation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Alex&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:14:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-week-based-on-day-name/m-p/808040#M5067</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T14:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Last year week based on day name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-week-based-on-day-name/m-p/808773#M5104</link>
      <description>&lt;P&gt;Thanks for your answer Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case we have several dates table so we have this names in brackes to know which one we have to use, just a name.&lt;/P&gt;&lt;P&gt;I have seen that&amp;nbsp;&lt;SPAN&gt;DATESYTD &lt;A href="https://dax.guide/datesytd/" target="_blank"&gt;https://dax.guide/datesytd/&lt;/A&gt;&amp;nbsp;function will sum all the values in the year, but I need to compare year and year-1 in two lines., gettin the same value in 201829 tan 201929 - Previous year. I have uploaded the question with an example.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried using the DATESYTD function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of&amp;nbsp;&lt;SPAN&gt;DATEADD('TableDates [Date]'[date]; -1; YEAR), you can use:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATESYTD ( 'TableDates [Date]'[Date] )&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;More info:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/datesytd-function-dax" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/dax/datesytd-function-dax&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, your table naming ('TableDates [Date]') is quite confusing as it has square brackets which are normally used for column notation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Alex&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 09:37:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-week-based-on-day-name/m-p/808773#M5104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-03T09:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Last year week based on day name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-week-based-on-day-name/m-p/808830#M5106</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this article&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.daxpatterns.com/time-patterns/" target="_blank"&gt;https://www.daxpatterns.com/time-patterns/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;will provide additional hints how to find the "exact" same timeframe in the past, of course one has to decide how leap years have to be handles.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 10:20:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-week-based-on-day-name/m-p/808830#M5106</guid>
      <dc:creator>TomMartens</dc:creator>
      <dc:date>2019-10-03T10:20:41Z</dc:date>
    </item>
  </channel>
</rss>

