<?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: Why is my slicer not affecting performances? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902439#M152065</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="739150" data-lia-user-login="Uchenzei" class="lia-mention lia-mention-user"&gt;Uchenzei&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;That is a deficiency in the generated query plan when following CALCULATE approach. In many scenarios The NoCALCULATE approach "introduced&amp;nbsp;by&amp;nbsp;&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;" generates a much simpler query plan and performs faster.&amp;nbsp;&lt;BR /&gt;In your case the engine generates a query plan that includes creating, inside the formula engine, a table that is the result of the Cartesian&amp;nbsp;product of the rows of the original table. In your case would be approximately 36,000 x 36,000/2 = 680,000,000 rows which exceeds&amp;nbsp;the cash limitations. Filters are applied later on inside the formula engine.&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2024 13:53:29 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2024-05-08T13:53:29Z</dc:date>
    <item>
      <title>Why is my slicer not affecting performances?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3901544#M152036</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have this table (say "myTable"):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;type&lt;/TD&gt;&lt;TD&gt;date&lt;/TD&gt;&lt;TD&gt;invoice&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;red&lt;/TD&gt;&lt;TD&gt;1-1-2000&lt;/TD&gt;&lt;TD&gt;$100.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;red&lt;/TD&gt;&lt;TD&gt;1-2-2000&lt;/TD&gt;&lt;TD&gt;$120.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;red&lt;/TD&gt;&lt;TD&gt;1-3-2000&lt;/TD&gt;&lt;TD&gt;$140.50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and so on for 6,000 records, all "red" type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This measure is returning how many years I need to wait (from that date on) to double my invoice:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;waitfor =&lt;BR /&gt;VAR this_date = SELECTEDVALUE(myTable[date])&lt;BR /&gt;VAR target_invoice = SELECTEDVALUE(myTable[invoice]) * 2&lt;BR /&gt;VAR future_date = CALCULATE(MIN(myTable[date]), myTable[date]&amp;gt;this_date, myTable[invoice]&amp;gt;=target_invoice)&lt;BR /&gt;RETURN&lt;BR /&gt;DATEDIFF(this_date, future_date, YEAR)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put both "date" and "waitfor" into a chart and it's all working well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I add more records to myTable so that I have this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6,000 records "red" type&lt;/P&gt;&lt;P&gt;6,000 records "yellow"&lt;/P&gt;&lt;P&gt;6,000 records "brown"&lt;/P&gt;&lt;P&gt;6,000 records "blue"&lt;/P&gt;&lt;P&gt;6,000 records "magenta"&lt;/P&gt;&lt;P&gt;6,000 records "cyan"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;36,000 records total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I add a slicer into my report page to slice for "type" column and in such slicer I select "red" only and as a result the previous measure stops working ("Visual has exceeded the available resources").&lt;/P&gt;&lt;P&gt;It looks like the measure is now taking 36,000 records into account instead of just 6,000. I expected the slicer selection to skips records other than "red". What's wrong in my knowledge, why is the first example working and the second isn't? And how can I get to have the second scenario working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 09:57:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3901544#M152036</guid>
      <dc:creator>Uchenzei</dc:creator>
      <dc:date>2024-05-08T09:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my slicer not affecting performances?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3901963#M152050</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="739150" data-lia-user-login="Uchenzei" class="lia-mention lia-mention-user"&gt;Uchenzei&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;waitfor =
VAR this_date =
    SELECTEDVALUE ( myTable[date] )
VAR target_invoice =
    SELECTEDVALUE ( myTable[invoice] ) * 2
VAR future_date =
    MINX (
        FILTER (
            ALLSELECTED ( myTable ),
            myTable[invoice] &amp;gt;= target_invoice
                &amp;amp;&amp;amp; myTable[date] &amp;gt; this_date
        ),
        myTable[date]
    )
RETURN
    DATEDIFF ( this_date, future_date, YEAR )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 May 2024 11:19:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3901963#M152050</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-05-08T11:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my slicer not affecting performances?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902042#M152051</link>
      <description>&lt;P&gt;Hi tamerj1,&lt;/P&gt;&lt;P&gt;your query works very well!&lt;/P&gt;&lt;P&gt;Can you please share your thoughts about your approach and why my query is not working like yours? Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 11:40:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902042#M152051</guid>
      <dc:creator>Uchenzei</dc:creator>
      <dc:date>2024-05-08T11:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my slicer not affecting performances?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902439#M152065</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="739150" data-lia-user-login="Uchenzei" class="lia-mention lia-mention-user"&gt;Uchenzei&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;That is a deficiency in the generated query plan when following CALCULATE approach. In many scenarios The NoCALCULATE approach "introduced&amp;nbsp;by&amp;nbsp;&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;" generates a much simpler query plan and performs faster.&amp;nbsp;&lt;BR /&gt;In your case the engine generates a query plan that includes creating, inside the formula engine, a table that is the result of the Cartesian&amp;nbsp;product of the rows of the original table. In your case would be approximately 36,000 x 36,000/2 = 680,000,000 rows which exceeds&amp;nbsp;the cash limitations. Filters are applied later on inside the formula engine.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 13:53:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902439#M152065</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-05-08T13:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my slicer not affecting performances?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902504#M152070</link>
      <description>&lt;P&gt;Thank you very much for your support.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 14:07:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902504#M152070</guid>
      <dc:creator>Uchenzei</dc:creator>
      <dc:date>2024-05-08T14:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my slicer not affecting performances?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902655#M152075</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;Wow! That CALCULATE Challenge knowledge is coming in handy!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 14:50:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902655#M152075</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-05-08T14:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my slicer not affecting performances?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902775#M152079</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;/P&gt;
&lt;P&gt;Exactly!&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 15:39:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-is-my-slicer-not-affecting-performances/m-p/3902775#M152079</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-05-08T15:39:45Z</dc:date>
    </item>
  </channel>
</rss>

