<?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: Slow performance of last 12 month meassure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2355397#M59947</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That could make sence, it seems to be an issue with Antal betalte donorer, I now put in the dax formular for this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(DISTINCTCOUNT(FactBetalingslinjer[DonorNummer]), USERELATIONSHIP(FactBetalingslinjer[DatoKeyBogfoeringsdato], DimDato[DatoKey]).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and my formular are now really long, do you have an idea to make it shortere and maybe better performing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sidste 12 måneder antal betalte donorer = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Maxdate = LASTDATE(DimDato[Dato] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Mindate = SAMEPERIODLASTYEAR(Maxdate)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Result =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(CALCULATE(DISTINCTCOUNT(FactBetalingslinjer[DonorNummer]), USERELATIONSHIP(FactBetalingslinjer[DatoKeyBogfoeringsdato], DimDato[DatoKey])), FILTER(ALL(DimDato), DimDato[Dato] &amp;lt;= Maxdate &amp;amp;&amp;amp; DimDato[Dato] &amp;gt; Mindate ) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Return Result&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 23 Feb 2022 09:00:06 GMT</pubDate>
    <dc:creator>FieF</dc:creator>
    <dc:date>2022-02-23T09:00:06Z</dc:date>
    <item>
      <title>Slow performance of last 12 month meassure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2341822#M59117</link>
      <description>&lt;P&gt;Hi Guys&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made this meassure to count that last running 12 months - I need help because the performance is very slow.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Dax:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Maxdate = LASTDATE(DimDato[Dato] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Mindate = SAMEPERIODLASTYEAR(Maxdate)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Result =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE([Antal betalte donorer], FILTER(ALL(DimDato), DimDato[Dato] &amp;lt;= Maxdate &amp;amp;&amp;amp; DimDato[Dato] &amp;gt; Mindate ) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Return Result&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It works as it should, but&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;It Is really slow around 25000 Ms every click I make, from the performance analysis I get from Power BI:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;// DAX Query&lt;BR /&gt;DEFINE&lt;BR /&gt;MEASURE 'FactBetalingslinjer'[Sidste 12 måneder antal betalte donorer] =&lt;BR /&gt;(/* USER DAX BEGIN */&lt;/P&gt;&lt;P&gt;VAR Maxdate = LASTDATE(DimDato[Dato] )&lt;BR /&gt;VAR Mindate = SAMEPERIODLASTYEAR(Maxdate)&lt;BR /&gt;VAR Result =&lt;BR /&gt;CALCULATE([Antal betalte donorer], FILTER(ALL(DimDato), DimDato[Dato] &amp;lt;= Maxdate &amp;amp;&amp;amp; DimDato[Dato] &amp;gt; Mindate ) )&lt;BR /&gt;Return Result&lt;BR /&gt;/* USER DAX END */)&lt;/P&gt;&lt;P&gt;VAR __DS0FilterTable =&lt;BR /&gt;FILTER(&lt;BR /&gt;KEEPFILTERS(VALUES('DimDato'[Dato])),&lt;BR /&gt;AND(&lt;BR /&gt;AND('DimDato'[Dato] &amp;gt;= DATE(2021, 1, 1), 'DimDato'[Dato] &amp;lt; DATE(2022, 1, 1)),&lt;BR /&gt;'DimDato'[Dato] &amp;gt;= (DATE(2020, 9, 1) + TIME(0, 0, 1))&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;VAR __DS0FilterTable2 =&lt;BR /&gt;FILTER(&lt;BR /&gt;KEEPFILTERS(VALUES('DimDonortype'[Donorgruppe])),&lt;BR /&gt;AND(&lt;BR /&gt;'DimDonortype'[Donorgruppe] IN {"Faste støtter"},&lt;BR /&gt;'DimDonortype'[Donorgruppe] IN {"Faste støtter"}&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;VAR __DS0Core =&lt;BR /&gt;SUMMARIZECOLUMNS(&lt;BR /&gt;'DimDato'[MånedÅr],&lt;BR /&gt;'DimDato'[FørsteDatoMåned],&lt;BR /&gt;__DS0FilterTable,&lt;BR /&gt;__DS0FilterTable2,&lt;BR /&gt;"Sidste 12 måneder antal betalte donorer", 'FactBetalingslinjer'[Sidste 12 måneder antal betalte donorer]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;VAR __DS0PrimaryWindowed =&lt;BR /&gt;TOPN(1001, __DS0Core, 'DimDato'[FørsteDatoMåned], 1, 'DimDato'[MånedÅr], 1)&lt;/P&gt;&lt;P&gt;EVALUATE&lt;BR /&gt;__DS0PrimaryWindowed&lt;/P&gt;&lt;P&gt;ORDER BY&lt;BR /&gt;'DimDato'[FørsteDatoMåned], 'DimDato'[MånedÅr]&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 10:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2341822#M59117</guid>
      <dc:creator>FieF</dc:creator>
      <dc:date>2022-02-16T10:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of last 12 month meassure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2341883#M59120</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="338807" data-lia-user-login="FieF" class="lia-mention lia-mention-user"&gt;FieF&lt;/a&gt; , please try a measure like &lt;/P&gt;
&lt;P&gt;Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH)) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and see it perform better&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 10:25:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2341883#M59120</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-02-16T10:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of last 12 month meassure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2341926#M59123</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your respond.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already tried this and it do not work, it does not give me 12 month like I want. we have seasons in payment at different intervals, so this formular does not return what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 10:43:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2341926#M59123</guid>
      <dc:creator>FieF</dc:creator>
      <dc:date>2022-02-16T10:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of last 12 month meassure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2341962#M59126</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="338807" data-lia-user-login="FieF" class="lia-mention lia-mention-user"&gt;FieF&lt;/a&gt; , do you need something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 12 Sales = &lt;BR /&gt;var _max = maxx(allselcted(date),date[date]) // or today() &lt;BR /&gt;var _min = date(year(_max), month(_max)-12,1)&lt;BR /&gt;return &lt;BR /&gt;CALCULATE(SUM(Sales[Sales Amount]),filter(all(date), date[date] &amp;lt;=_max &amp;amp;&amp;amp; date[date] &amp;gt;=_min))&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 11:00:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2341962#M59126</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-02-16T11:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of last 12 month meassure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2350885#M59658</link>
      <description>&lt;P&gt;Hi Again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, the performance for this is as slow as the one I already have. I dont know why it performs that slow.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 10:46:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2350885#M59658</guid>
      <dc:creator>FieF</dc:creator>
      <dc:date>2022-02-21T10:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of last 12 month meassure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2352603#M59781</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="338807" data-lia-user-login="FieF" class="lia-mention lia-mention-user"&gt;FieF&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about the performance of &lt;SPAN&gt;[Antal betalte donorer]&lt;/SPAN&gt;?&lt;/P&gt;
&lt;P&gt;Report performance is usually related to the size of pbix, the performance of local computer and the performance of DAX formula.&lt;/P&gt;
&lt;P&gt;Please refer to these blogs:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blog.pragmaticworks.com/power-bi-performance-tips-and-techniques" target="_self"&gt;https://blog.pragmaticworks.com/power-bi-performance-tips-and-techniques&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://maqsoftware.com/insights/dax-best-practices" target="_self"&gt;https://maqsoftware.com/insights/dax-best-practices&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Liang&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 06:56:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2352603#M59781</guid>
      <dc:creator>V-lianl-msft</dc:creator>
      <dc:date>2022-02-22T06:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of last 12 month meassure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2355397#M59947</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That could make sence, it seems to be an issue with Antal betalte donorer, I now put in the dax formular for this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(DISTINCTCOUNT(FactBetalingslinjer[DonorNummer]), USERELATIONSHIP(FactBetalingslinjer[DatoKeyBogfoeringsdato], DimDato[DatoKey]).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and my formular are now really long, do you have an idea to make it shortere and maybe better performing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sidste 12 måneder antal betalte donorer = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Maxdate = LASTDATE(DimDato[Dato] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Mindate = SAMEPERIODLASTYEAR(Maxdate)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Result =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(CALCULATE(DISTINCTCOUNT(FactBetalingslinjer[DonorNummer]), USERELATIONSHIP(FactBetalingslinjer[DatoKeyBogfoeringsdato], DimDato[DatoKey])), FILTER(ALL(DimDato), DimDato[Dato] &amp;lt;= Maxdate &amp;amp;&amp;amp; DimDato[Dato] &amp;gt; Mindate ) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Return Result&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Feb 2022 09:00:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slow-performance-of-last-12-month-meassure/m-p/2355397#M59947</guid>
      <dc:creator>FieF</dc:creator>
      <dc:date>2022-02-23T09:00:06Z</dc:date>
    </item>
  </channel>
</rss>

