<?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 Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736309#M2040</link>
    <description>&lt;P&gt;I create three calculated Tables from my Date Dimension Table 'Order Date' and I see different days than expected.&lt;/P&gt;&lt;P&gt;Table 1 = DATESYTD('Order Date'[Date])&lt;/P&gt;&lt;P&gt;Table 2 = DATEADD(DATESYTD('Order Date'[Date]),-1,YEAR)&lt;/P&gt;&lt;P&gt;Table 3 = SAMEPERIODLASTYEAR(DATESYTD('Order Date'[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assume that today is the 9th of July 2019.&lt;/P&gt;&lt;P&gt;The first table shows as expected dates from the 1st of January of the current year till today (e.g., 01.01.2019-09.07.2019)&lt;/P&gt;&lt;P&gt;The second and third tables shows dates from the 1st of January of the previous year till end of the current month as of today (e.g., July) in last year (e.g., 01.01.2018-&lt;STRONG&gt;31&lt;/STRONG&gt;.07.2018)!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would expect Tables 2 and 3 to return the following dates 01.01.2018 - 09.07.2018 instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I miss something?&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 09:49:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-07-10T09:49:26Z</dc:date>
    <item>
      <title>Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736309#M2040</link>
      <description>&lt;P&gt;I create three calculated Tables from my Date Dimension Table 'Order Date' and I see different days than expected.&lt;/P&gt;&lt;P&gt;Table 1 = DATESYTD('Order Date'[Date])&lt;/P&gt;&lt;P&gt;Table 2 = DATEADD(DATESYTD('Order Date'[Date]),-1,YEAR)&lt;/P&gt;&lt;P&gt;Table 3 = SAMEPERIODLASTYEAR(DATESYTD('Order Date'[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assume that today is the 9th of July 2019.&lt;/P&gt;&lt;P&gt;The first table shows as expected dates from the 1st of January of the current year till today (e.g., 01.01.2019-09.07.2019)&lt;/P&gt;&lt;P&gt;The second and third tables shows dates from the 1st of January of the previous year till end of the current month as of today (e.g., July) in last year (e.g., 01.01.2018-&lt;STRONG&gt;31&lt;/STRONG&gt;.07.2018)!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would expect Tables 2 and 3 to return the following dates 01.01.2018 - 09.07.2018 instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I miss something?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 09:49:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736309#M2040</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T09:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736336#M2042</link>
      <description>&lt;P&gt;The very fact that Table 1 ends on 9 July 2019 means that your Date dimension table 'Order Date' is not a real Date Table marked as such in the model. Sort out your model first. If the dimension is not correctly built, then the date intelligence functions will not work correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 09:56:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736336#M2042</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T09:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736403#M2047</link>
      <description>&lt;P&gt;Dear Darek,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your reply. The Table 1 ends of 9th of July 2019 because of the DATESYTD function. So Actualy Table shows what I am expecting to see. I do not understand yous statement that "&lt;SPAN&gt;your Date dimension table 'Order Date' is not a real Date Table marked as such in the model&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;'Order Date' table has a column [Date] of type Date with has dates from the begining of 2005 till the end of 2020. Could you elaborate further? Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 10:55:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736403#M2047</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T10:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736413#M2050</link>
      <description>&lt;P&gt;If you had a real date table in your model, then applying DATESYTD to it would yield the full last year that exists in the table, in your case it would be the whole year 2020. I've checked it. This is because if there is no filter on the table, the last day visible would be the very last day and DATESYTD would then use this very last day and returned all the dates in the year up to this very last day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 11:07:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736413#M2050</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T11:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736423#M2051</link>
      <description>&lt;P&gt;If "Order Dates' is A REAL DATE TABLE IN THE MODEL, then this is what you want:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[Dates YTD Up to Today] =
var __today = today()
RETURN
	CALCULATETABLE(
		DATESYTD( 'Order Dates'[Date] ),
		'Order Dates'[Date] &amp;lt;= __today
	)
	
[Dates YTD Up to Today Shifted 1 Year Back] =
var __today = today()
return
	CALCULATETABLE(
		SAMEPERIODLASTYEAR( DATESYTD( 'Order Dates'[Date] ) ),
		'Order Dates'[Date] &amp;lt;= __today		
	)&lt;/PRE&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 11:13:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736423#M2051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T11:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736451#M2053</link>
      <description>&lt;P&gt;This is not my understanding of the DATESYTD function. The DATESYTD function should return all dates starting on the 1st of January of the current year till today irrespective of which is the last date in the Date Dimension.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 11:50:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736451#M2053</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T11:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736488#M2056</link>
      <description>&lt;P&gt;Sorry but your understanding is wrong then. Please go to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://dax.guide/datesytd/" target="_blank"&gt;https://dax.guide/datesytd/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and read. You have to know that the function operates on filters. It has no knowledge about what the current day is today. If it did, it would be totally useless in calculations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 12:16:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736488#M2056</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T12:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736544#M2060</link>
      <description>&lt;P&gt;I am still confused. What I read is "&lt;SPAN&gt;Returns a set of dates in the year up to current date&lt;/SPAN&gt;" current date means that it knows what the curent day is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not then could you please give me a few examples of what DATESYTD would return given a specific inputs? Thank you for your time.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 13:04:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736544#M2060</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T13:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736572#M2063</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Current Date&lt;/STRONG&gt; always means the current date &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;as visible in the current filter context&lt;/STRONG&gt;&lt;/FONT&gt;. As I said, if that was always the current &lt;STRONG&gt;real&lt;/STRONG&gt; date, the function would be of no use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you select Sep-1999 in your date table, then DATESYTD( Dates[Date] ) will return dates from 1999-01-01 up to and including the last day of September 1999.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 13:24:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues-with-SAMEPERIODLASTYEAR-and-DATEADD/m-p/736572#M2063</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T13:24:55Z</dc:date>
    </item>
  </channel>
</rss>

