<?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: DATEADDslows measure down in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/760172#M3152</link>
    <description>No idea... but you should capture the query plans using DAX Studio. Then and only then will you be able to see the differences between the simple measure and the one that makes trouble and figure out where the problem lies.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
    <pubDate>Wed, 07 Aug 2019 09:17:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-07T09:17:31Z</dc:date>
    <item>
      <title>DATEADDslows measure down</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/757762#M3089</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a measure that really slows down by using the DATEADD function.&lt;/P&gt;&lt;P&gt;CALCULATE(DISTINCTCOUNT(Employee[EmployeeID]) , DATEADD('Date'[Date],-1,DAY))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a better way to get the same output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luuk&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 11:53:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/757762#M3089</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-05T11:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADDslows measure down</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/758968#M3122</link>
      <description>If this slows down, then it might mean your model is incorrectly built. I've never seen a good model where you'd have a fast measure which would slow down after applying the transformation in question.&lt;BR /&gt;&lt;BR /&gt;But without knowing the guts of your model, nobody will be able to tell you anything.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
      <pubDate>Tue, 06 Aug 2019 11:06:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/758968#M3122</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-06T11:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADDslows measure down</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/759172#M3126</link>
      <description>&lt;P&gt;Hi Darek,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="oSioSc"&gt;&lt;DIV&gt;&lt;DIV class="g9WsWb"&gt;&lt;DIV class="tw-ta-container tw-nfl"&gt;It is difficult for me to determine where the model is incorrect.&lt;/DIV&gt;&lt;DIV class="tw-ta-container tw-nfl"&gt;I don't have problems with other measures.&lt;/DIV&gt;&lt;DIV class="tw-ta-container tw-nfl"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="tw-ta-container tw-nfl"&gt;The model consists a fact table and several dimensions (9).&lt;/DIV&gt;&lt;DIV class="tw-ta-container tw-nfl"&gt;The fact table contains employee data such as salary, absence,&amp;nbsp;etcetera.&lt;/DIV&gt;&lt;DIV class="tw-ta-container tw-nfl"&gt;&lt;SPAN&gt;There is a row in the dataset for every employee every day, total about 20 million rows.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="tw-ta-container tw-nfl"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="tw-ta-container tw-nfl"&gt;&lt;SPAN&gt;Is it possible other perspectives slow this perspective down?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="tw-ta-container tw-nfl"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="tw-ta-container tw-nfl"&gt;&lt;SPAN&gt;Luuk&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Aug 2019 14:10:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/759172#M3126</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-06T14:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADDslows measure down</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/759378#M3128</link>
      <description>Well, you know, whether a model is good or not depends on what you want to do inside it. One problem can have many substantially different formulations (just like in mathematics) depending on which angle you want to look at it...&lt;BR /&gt;&lt;BR /&gt;However, if you have one fact table that's connected to dimensions in a *-to-1 fashion and date tables marked as Date Tables in the model (and if they're correctly designed), then I can't see a reason why the measure should be substantially slower than the others.&lt;BR /&gt;&lt;BR /&gt;Have you compared the performance of the simple measure DISTINCTCOUNT(Employee[EmployeeID]) with the one in question?&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
      <pubDate>Tue, 06 Aug 2019 17:20:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/759378#M3128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-06T17:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADDslows measure down</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/759380#M3129</link>
      <description>By the way.... Is your storage model Import or DirectQuery?&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
      <pubDate>Tue, 06 Aug 2019 17:20:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/759380#M3129</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-06T17:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADDslows measure down</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/759951#M3149</link>
      <description>&lt;P&gt;What could be the reason the measure slows down by the *- to -1 relations and the date marked table?&lt;/P&gt;&lt;P&gt;It is an import storage model and the measure DISTINCTCOUNT(Employee[EmployeeID])&amp;nbsp;performs without problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luuk&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 06:47:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/759951#M3149</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-07T06:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADDslows measure down</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/760172#M3152</link>
      <description>No idea... but you should capture the query plans using DAX Studio. Then and only then will you be able to see the differences between the simple measure and the one that makes trouble and figure out where the problem lies.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
      <pubDate>Wed, 07 Aug 2019 09:17:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/760172#M3152</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-07T09:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADDslows measure down</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/840909#M6361</link>
      <description>&lt;P&gt;Hi Luuk,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Been in your shoes! Almost exact problem, except that in my case it was DATEADD -1 YEAR over a DISTINCTCOUNT, for Month-over-month calculations. (same thing for -1 month)&lt;/P&gt;&lt;P&gt;What I found tracing with DAX was that adding DATEADD multiplied the number of SE queries performed. It did not have a huge impact if the model was hot (thanks to DAX caching), but it had a huge impact (3x time) in cold models / clear cache / fist load.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did was change the DATEADD, which I understand is done by the FE, into something I hoped closer to the SE. This is what improved quite a a lot the measure in my case:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;/* --original query, relatively slow&lt;BR /&gt;VAR __clients_last_year = CALCULATE([clients],DATEADD(DateTable[Date],-1,YEAR))&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;IF(ISBLANK([clients]),blank(),DIVIDE([clients]-__clients_last_year , __clients_last_year ))&lt;BR /&gt;*/&lt;/P&gt;&lt;P&gt;-- optimized -- note that this only works for single selections of date!&lt;/P&gt;&lt;P&gt;VAR __M_ANT = EDATE(selectedvalue(FactTable[date]) , -12)&amp;nbsp;&amp;nbsp; -- EDATE adds months&lt;BR /&gt;VAR __clients_last_year= CALCULATE([clients], ALL(DateTable), FactTable[date] = __M_ANT)&lt;BR /&gt;RETURN&lt;BR /&gt;DIVIDE([clients] - __clients_last_year, __clients_last_year)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This only works for single selections of date, but was about 3x more performant in my use case in cold calculations of the measure (which was used very often in my reports).&lt;/P&gt;&lt;P&gt;In your case, to add one day, it is much simpler than using EDATE.. just add +1 to move one day forward.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 10:22:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADDslows-measure-down/m-p/840909#M6361</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-08T10:22:41Z</dc:date>
    </item>
  </channel>
</rss>

