<?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: DATEADD &amp;quot;expects a contiguous selection when the date column is not unique, has gaps...&amp;quot; in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701175#M804</link>
    <description>&lt;P&gt;Thnks for this HotChilli.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm now trying to set up a Dates table, but am getting weird results at the first step - as you wan see from the amage below, I'm aiming to set up a dates table for all days between 2010 and 2035 but Power BI in starting my table on 23/6/1906(!) and ending&amp;nbsp; it on 16/016/1937 (!!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2019 08:23:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-05-28T08:23:29Z</dc:date>
    <item>
      <title>DATEADD "expects a contiguous selection when the date column is not unique, has gaps..."</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/699964#M774</link>
      <description>&lt;P&gt;I'm trying out some DAX functions on the following data:&lt;/P&gt;&lt;P&gt;I&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I've set up this measure&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Sales YTD = Calculate(TOTALYTD(SUM(Sales[Sale£]),Sales[OrderDate]))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and used it in the following table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Now I'd like&amp;nbsp;to add in sales for the previous year, so I've created a new measure&amp;nbsp;using DATEADD:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Sales LY = Calculate(SUM(Sales[Sale£]),DATEADD(Sales[OrderDate],-1,YEAR))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;But when I try to add this to the above table, I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This doentn't make much sense to be.&amp;nbsp; What does it mean that "the date column is not unique" - does it expect&amp;nbsp;unique date values? In the context of my example, this is nonsense as there are&amp;nbsp;many orders&amp;nbsp;on some days and none on many other days!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 May 2019 11:23:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/699964#M774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-26T11:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD "expects a contiguous selection when the date column is not unique, has gaps..."</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/699969#M775</link>
      <description>&lt;P&gt;Source data is at&amp;nbsp;&amp;nbsp;&lt;A href="https://1drv.ms/x/s!AmxJyApgEAcYgtUghDmk57MBicCw0A" target="_blank"&gt;https://1drv.ms/x/s!AmxJyApgEAcYgtUghDmk57MBicCw0A&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Desktop is at&amp;nbsp;&amp;nbsp;&lt;A href="https://1drv.ms/u/s!AmxJyApgEAcYgtUjeBKUTlHNCDxE_w" target="_blank"&gt;https://1drv.ms/u/s!AmxJyApgEAcYgtUjeBKUTlHNCDxE_w&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 May 2019 12:24:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/699969#M775</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-26T12:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD "expects a contiguous selection when the date column is not unique, has gaps..."</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/700038#M778</link>
      <description>&lt;P&gt;Time intelligence works best when you have a Date table.&lt;/P&gt;&lt;P&gt;Depending on your data, DATEADD won't play nicely if you don't use a Date table.&amp;nbsp; That's what the message is all about.&lt;/P&gt;&lt;P&gt;In the visualisation that is complaining about the Sales LY measure, there isn't really a concept of current year and last year because there is no date field&amp;nbsp; in the table.&lt;/P&gt;&lt;P&gt;You can see in the other visualisation that has 'Sales LY', and doesn't complain, that the results are patchy as there isn't&amp;nbsp; equivalent data from the day a year previous for many of the rows.&lt;/P&gt;</description>
      <pubDate>Sun, 26 May 2019 19:13:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/700038#M778</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2019-05-26T19:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD "expects a contiguous selection when the date column is not unique, has gaps..."</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701175#M804</link>
      <description>&lt;P&gt;Thnks for this HotChilli.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm now trying to set up a Dates table, but am getting weird results at the first step - as you wan see from the amage below, I'm aiming to set up a dates table for all days between 2010 and 2035 but Power BI in starting my table on 23/6/1906(!) and ending&amp;nbsp; it on 16/016/1937 (!!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 08:23:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701175#M804</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-28T08:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD "expects a contiguous selection when the date column is not unique, has gaps..."</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701219#M806</link>
      <description>&lt;P&gt;Just worked out the answer to this, I've got the parameters in the wrong&amp;nbsp; order.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Duh!!&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 09:00:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701219#M806</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-28T09:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD "expects a contiguous selection when the date column is not unique, has gaps..."</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701537#M818</link>
      <description>&lt;P&gt;OK, now I've created a Dates Table and related it for the "Order Date" on the "Sales" table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also created a new Measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sales SPLY = Calculate([Total Sales],SAMEPERIODLASTYEAR('Date Table'[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I use this measure in a simple Order date: Total sales table, it seems to ignore the SAMEPERIODLASTYEAR parameter - "Total" Sales always equals "Sales SPLY"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PBI Desktop Doc is at&amp;nbsp;&lt;A href="https://1drv.ms/u/s!AmxJyApgEAcYgtUoRdtcWBWIJcYTrQ" target="_blank"&gt;https://1drv.ms/u/s!AmxJyApgEAcYgtUoRdtcWBWIJcYTrQ&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:17:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701537#M818</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-28T15:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD "expects a contiguous selection when the date column is not unique, has gaps..."</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701574#M822</link>
      <description>&lt;P&gt;Are you using the Date from the Date table in the visualisation?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:50:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701574#M822</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2019-05-28T15:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD "expects a contiguous selection when the date column is not unique, has gaps..."</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701606#M828</link>
      <description>&lt;P&gt;In the measure, yes, but not in the Table, where I use "Order Date", from the Sales table:::&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sales SPLY = Calculate([Total Sales],SAMEPERIODLASTYEAR&lt;FONT color="#FF0000"&gt;('Date Table'[Date]))&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;&lt;img /&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;S&lt;/EM&gt;o I've tried using the Date from "Dates Table" and it seems to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not entirely sure why one way works and another doesn't, I need to mug up on DAX date processing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 16:15:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/701606#M828</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-28T16:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD "expects a contiguous selection when the date column is not unique, has gaps..."</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/2214899#M52389</link>
      <description>&lt;P&gt;I had a very similar problem, but was able to solve it using this person's solution:&lt;BR /&gt;&lt;A href="https://p3adaptive.com/2014/01/defanging-the-contiguous-date-selections-error/" target="_blank"&gt;Defanging the “contiguous date selections” error - P3 Adaptive&lt;/A&gt;&lt;BR /&gt;Basically I incorporated an If(hasonevalue segment in the formula.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 21:59:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/2214899#M52389</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-30T21:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD "expects a contiguous selection when the date column is not unique, has gaps..."</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/3091282#M108307</link>
      <description>&lt;P&gt;This is the best solution I would say, no need to create date table.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 20:43:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-quot-expects-a-contiguous-selection-when-the-date-column/m-p/3091282#M108307</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-21T20:43:00Z</dc:date>
    </item>
  </channel>
</rss>

