<?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: Can this DAX be optimized? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-this-DAX-be-optimized/m-p/3262658#M120709</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6923" data-lia-user-login="Bokazoit" class="lia-mention lia-mention-user"&gt;Bokazoit&lt;/a&gt;&amp;nbsp;I do not understand you table name except that Fact* your fact table. If so, use ADD( SUMMARIZE pattern as variable and after that filter results.&lt;/P&gt;</description>
    <pubDate>Wed, 31 May 2023 21:32:52 GMT</pubDate>
    <dc:creator>some_bih</dc:creator>
    <dc:date>2023-05-31T21:32:52Z</dc:date>
    <item>
      <title>Can this DAX be optimized?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-this-DAX-be-optimized/m-p/3195226#M115984</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wonder if this Measure can be optimized a bit? I works as intended, but is a bit slow&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Seneste betalingsmetode = 

VAR SenestBetalt = CALCULATE(
                        MAX(FactBetalingslinjer[DatoKeyStoettePeriode]), 
                        FactBetalingslinjer[#Payed Amount (GL)] &amp;gt; 0 
                        )

VAR BetaltMetode = CALCULATE(
                        MAX(FactBetalingslinjer[BetalingsmetodeKey]), 
                        FactBetalingslinjer[DatoKeyStoettePeriode] = SenestBetalt
                        )

VAR Metode = CALCULATE( 
                        MAX(DimBetalingsmetode[BetalingsmetodeNavn]), 
                        DimBetalingsmetode[BetalingsmetodeKey] = BetaltMetode
                        )

RETURN

Metode&lt;/LI-CODE&gt;
&lt;P&gt;I need to find the latest period based on latest payment (Variable SenestBetalt)&lt;BR /&gt;Then from that date I like to find the payment type (Variable BetaltMetode)&lt;BR /&gt;Finally I get the paymeny name from the dimension (Variable Metode)&lt;BR /&gt;&lt;BR /&gt;The final part is needed (I think) because it's a starschema with all dimensions pointing at FactBetalingslinjer, so I can find the key and then get the name from the dimension.&lt;BR /&gt;&lt;BR /&gt;But can it be done smarter? and can it be done faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 08:05:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-this-DAX-be-optimized/m-p/3195226#M115984</guid>
      <dc:creator>Bokazoit</dc:creator>
      <dc:date>2023-04-19T08:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can this DAX be optimized?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-this-DAX-be-optimized/m-p/3262658#M120709</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6923" data-lia-user-login="Bokazoit" class="lia-mention lia-mention-user"&gt;Bokazoit&lt;/a&gt;&amp;nbsp;I do not understand you table name except that Fact* your fact table. If so, use ADD( SUMMARIZE pattern as variable and after that filter results.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 21:32:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-this-DAX-be-optimized/m-p/3262658#M120709</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-05-31T21:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can this DAX be optimized?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-this-DAX-be-optimized/m-p/3263974#M120782</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6923" data-lia-user-login="Bokazoit" class="lia-mention lia-mention-user"&gt;Bokazoit&lt;/a&gt;&amp;nbsp;I do not understand you table name except that Fact* your fact table. If so, use ADD( SUMMARIZE pattern as variable and after that filter results.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 13:38:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-this-DAX-be-optimized/m-p/3263974#M120782</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-06-01T13:38:40Z</dc:date>
    </item>
  </channel>
</rss>

