<?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: DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2351523#M59714</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223071" data-lia-user-login="mohamedmutter" class="lia-mention lia-mention-user"&gt;mohamedmutter&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an alternative way to calculate this.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Player Loads 15 Days = 
SUMX(
	FILTER(FACT_bq_dp_iir_smp_summary, FACT_bq_dp_iir_smp_summary[Date] - RELATED('Pub Live Dates'[Live Date]) &amp;lt; 15),
	FACT_bq_dp_iir_smp_summary[Player Loads]
	)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Worth trying to see if it's any quicker.&amp;nbsp; It's resolved with a single storage engine query so may give you better performance.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Feb 2022 15:42:53 GMT</pubDate>
    <dc:creator>PaulOlding</dc:creator>
    <dc:date>2022-02-21T15:42:53Z</dc:date>
    <item>
      <title>DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2348233#M59461</link>
      <description>&lt;P&gt;I have a DAX Query that performance analyzer is telling me is taking roughly 12-15 seconds which is obviously no good. I am attempting to calculate the number of player loads a publisher has had since their "live date" / onboarding date in increments of 15/30/45/60/90 days. Essentially little checkpoints since they became a customer.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So I want the SUM(player loads) between their live date and 15 days after, between live date and 30 days after and so on.&amp;nbsp;I have a calendar table (Screenshotted below) that contains all dates since 2014 - present.&amp;nbsp;My table that has all the publisher live dates does not contain a full list of all dates, only the dates they went live. I have a publisher key table using c_id that is joining my fact table to my live date table that is using one to many relationships.&lt;BR /&gt;&lt;BR /&gt;Here is my DAX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Player Loads 15 Days =
CALCULATE (
    SUM ( FACT_bq_dp_iir_smp_summary[Player Loads] ),
    DATESINPERIOD (
        DIM_Calendar[Date],
        MAX ( 'Pub Live Dates'[Live Date] ),
        +15,
        DAY
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i put this DAX along with the 4 other measures for +30/45/60/90 days, the time to process is roughly 12-15 seconds. Is this the most DAX efficient way to write this? Or is there some other method that could be better?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&lt;img /&gt;&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 18:28:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2348233#M59461</guid>
      <dc:creator>mohamedmutter</dc:creator>
      <dc:date>2022-02-18T18:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2348341#M59469</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223071" data-lia-user-login="mohamedmutter" class="lia-mention lia-mention-user"&gt;mohamedmutter&lt;/a&gt;&amp;nbsp;Why not:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Player Loads 15 Days =
  VAR __Date = MAX ( 'Pub Live Dates'[Live Date] )
  VAR __Date15 = __Date + 15
RETURN
CALCULATE (
    SUM ( FACT_bq_dp_iir_smp_summary[Player Loads] ),
    FILTER (
        DIM_Calendar[Date],
        [Date] &amp;gt;= __Date &amp;amp;&amp;amp; [Date] &amp;lt;= __Date15
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 18 Feb 2022 20:09:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2348341#M59469</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-02-18T20:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2348571#M59493</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;I tried yours, and somehow with just that measure in the table and nothing else, it's up to almost&amp;nbsp;&lt;EM&gt;70 seconds&amp;nbsp;&lt;/EM&gt;to load now. Does it matter that I have BLANK dates in the pub live dates table that could be tripping this up?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 00:25:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2348571#M59493</guid>
      <dc:creator>mohamedmutter</dc:creator>
      <dc:date>2022-02-19T00:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2348940#M59544</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223071" data-lia-user-login="mohamedmutter" class="lia-mention lia-mention-user"&gt;mohamedmutter&lt;/a&gt;&amp;nbsp;Well, something is clearly not right. I am guessing that you have some sort of data modeling issue going on at the heart of all of this. What does your data model look like?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 17:52:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2348940#M59544</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-02-19T17:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2351523#M59714</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223071" data-lia-user-login="mohamedmutter" class="lia-mention lia-mention-user"&gt;mohamedmutter&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an alternative way to calculate this.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Player Loads 15 Days = 
SUMX(
	FILTER(FACT_bq_dp_iir_smp_summary, FACT_bq_dp_iir_smp_summary[Date] - RELATED('Pub Live Dates'[Live Date]) &amp;lt; 15),
	FACT_bq_dp_iir_smp_summary[Player Loads]
	)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Worth trying to see if it's any quicker.&amp;nbsp; It's resolved with a single storage engine query so may give you better performance.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 15:42:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2351523#M59714</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2022-02-21T15:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2353696#M59848</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;All my relationships are one --&amp;gt; many.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a main fact table where I'm getting my player loads, that is linking by an id field to my publisher table. That publisher table links to to my publisher live dates table via an id field. Then both the publisher live dates table and my main fact table are linking to a calendar table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My main fact table in the service will be pushing roughly 100 mm rows though. But in my desktop app I've limited it via a Keep Top Rows parameter to 15 million. One other strange note, is that when trying to refresh this 15 mm row data set in the service, I'm getting an error with our 32 GB RAM Gateway running out of memory during the process. This wasn't happening before I added these measures in.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 14:53:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2353696#M59848</guid>
      <dc:creator>mohamedmutter</dc:creator>
      <dc:date>2022-02-22T14:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2353697#M59849</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="150936" data-lia-user-login="PaulOlding" class="lia-mention lia-mention-user"&gt;PaulOlding&lt;/a&gt;&amp;nbsp;I've tried the above, but in the RELATED('Pub Live Dates'[Live Date]) section ... it won't let me actually select that field for the measure.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 14:54:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2353697#M59849</guid>
      <dc:creator>mohamedmutter</dc:creator>
      <dc:date>2022-02-22T14:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2353798#M59854</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223071" data-lia-user-login="mohamedmutter" class="lia-mention lia-mention-user"&gt;mohamedmutter&lt;/a&gt;&amp;nbsp;what are the relationships between the tables in the model?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 15:36:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2353798#M59854</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2022-02-22T15:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2353868#M59855</link>
      <description>&lt;P&gt;Here's an image of my relationships. Basically I have a key table for my publishers using c_id which links my main fact table through my pub live date table. And then the main date fields (live date for pub_live_date) all link to my calendar table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 15:54:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2353868#M59855</guid>
      <dc:creator>mohamedmutter</dc:creator>
      <dc:date>2022-02-22T15:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: DATESINPERIOD DAX Measure Taking 13 Seconds to Run, Is Another Time Intelligence Function Better?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2356019#M60008</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223071" data-lia-user-login="mohamedmutter" class="lia-mention lia-mention-user"&gt;mohamedmutter&lt;/a&gt;&amp;nbsp;Yeah, with that setup, Pub Live Dates does not have a relationship with your fact table so basically you are getting "all". So if you have millions of rows in there that could take some time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could potentially solve this with CROSSFILTER or USERELATIONSHIP potentially. Create an inactive relationship between your tables, for example based on c_id. Another thought is it would be intereting to see how long this takes:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;  VAR __Date = MAX ( 'Pub Live Dates'[Live Date] )
  VAR __Date15 = __Date + 15
  VAR __Table =     FILTER (
        FACT_bq_dp_iir_smp_summary,
        [date] &amp;gt;= __Date &amp;amp;&amp;amp; [date] &amp;lt;= __Date15
    )
RETURN
    SUMX ( __Table, [Player Loads] )

Or


Player Loads 15 Days =
  VAR __Date = MAX ( 'Pub Live Dates'[Live Date] )
  VAR __Date15 = __Date + 15
RETURN
CALCULATE (
    SUM ( FACT_bq_dp_iir_smp_summary[Player Loads] ),
    FILTER (
        FACT_bq_dp_iir_smp_summary,
        [date] &amp;gt;= __Date &amp;amp;&amp;amp; [date] &amp;lt;= __Date15
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Feb 2022 13:21:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATESINPERIOD-DAX-Measure-Taking-13-Seconds-to-Run-Is-Another/m-p/2356019#M60008</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-02-23T13:21:41Z</dc:date>
    </item>
  </channel>
</rss>

