<?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: Direct Query - Time Function - Slow Performance in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4801603#M183697</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="624462" data-lia-user-login="Pawel_1990" class="lia-mention lia-mention-user"&gt;Pawel_1990&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try this visual filter logic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Data Model:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IS_IN_LAST13_MONTHS =&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DIM_DATE&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;EOMONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DIM_DATE1&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),-&lt;/SPAN&gt;&lt;SPAN&gt;13&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DIM_DATE&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;lt;=&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DIM_DATE1&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&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;Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Aug 2025 02:46:39 GMT</pubDate>
    <dc:creator>Aburar_123</dc:creator>
    <dc:date>2025-08-20T02:46:39Z</dc:date>
    <item>
      <title>Direct Query - Time Function - Slow Performance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4797277#M183574</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am using Direct Query Snowflake table as data source. One of measures is working slow. I was thinking if DAX can be written in other way to speed up performance.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Dashboards has main date table and secondary date table. Slicer on each page is added and forced single select to pick only 1 month. On some pages visual showing last 13 months is added as well.&lt;BR /&gt;&lt;BR /&gt;Dax code below:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Measure #1 - Sum loggin&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#Scale = 
VAR SCALE = CALCULATE(SUM(Table1[LOGIN_COUNT]),
Table1[AGGREGATION_TYPE] = "Type1", 
KEEPFILTERS(Dim_Country[COUNTRY_CODE] &amp;lt;&amp;gt; BLANK()))

RETURN
SCALE&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Measure #2 - To show last 13 months on visual, when only 1 month selected on slicer&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#Scal 13M = 
VAR NumOfMonths = -13
VAR Min _Date_13M = EOMONTH(MAX ( 'MAIN_DATE'[CALENDAR_DATE]), -13)
VAR ReferenceDate = MAX ( 'MAIN_DATE'[CALENDAR_DATE])
VAR PreviousDates =
    FILTER(DATESINPERIOD (
        'SECONDARY_DATE'[CALENDAR_DATE],
        ReferenceDate,
        NumOfMonths,
        MONTH
    ), 'SECONDARY_DATE'[CALENDAR_DATE] &amp;gt; Min _Date_13M)
VAR Result =
    CALCULATE ([#Scale],
        REMOVEFILTERS(MAIN_DATE),
        KEEPFILTERS ( PreviousDates ),
        USERELATIONSHIP('SECONDARY_DATE'[CALENDAR_DATE], MAIN_DATE[CALENDAR_DATE])
    )
RETURN Result&lt;/LI-CODE&gt;&lt;P&gt;Thank you for help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 15:37:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4797277#M183574</guid>
      <dc:creator>Pawel_1990</dc:creator>
      <dc:date>2025-08-14T15:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Query - Time Function - Slow Performance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4797303#M183575</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="624462" data-lia-user-login="Pawel_1990" class="lia-mention lia-mention-user"&gt;Pawel_1990&lt;/a&gt;&amp;nbsp;If the time function is causing you issues, you could try an alternative.&amp;nbsp;You may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 16:09:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4797303#M183575</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2025-08-14T16:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Query - Time Function - Slow Performance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4801318#M183690</link>
      <description>&lt;P&gt;DirectQuery is always slower than Import&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your DAX is OK but performance in directquery depends on the source structure, internet connection and so forth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why not using Import instead of DirectQuery?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this helped, please consider giving kudos and mark as a solution&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="273" data-lia-user-login="me" class="lia-mention lia-mention-user"&gt;me&lt;/a&gt; in replies or I'll lose your thread&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Want to check your DAX skills? &lt;A href="https://www.linkedin.com/company/kubisco/" target="_blank"&gt;Answer my biweekly DAX challenges on the kubisco Linkedin page&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Consider voting &lt;A href="https://community.fabric.microsoft.com/t5/Fabric-Ideas/Power-BI-Filter-Pane-as-an-icon-on-the-right-side-bar-in-on/idi-p/4728588" target="_blank"&gt;this Power BI idea&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Francesco Bergamaschi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MBA, M.Eng, M.Econ, Professor of BI&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 16:51:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4801318#M183690</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2025-08-19T16:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Query - Time Function - Slow Performance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4801603#M183697</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="624462" data-lia-user-login="Pawel_1990" class="lia-mention lia-mention-user"&gt;Pawel_1990&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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N&gt;&lt;/DIV&gt;&lt;/DIV&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;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 02:46:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4801603#M183697</guid>
      <dc:creator>Aburar_123</dc:creator>
      <dc:date>2025-08-20T02:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Query - Time Function - Slow Performance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4801758#M183701</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="624462" data-lia-user-login="Pawel_1990" class="lia-mention lia-mention-user"&gt;Pawel_1990&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337302" data-lia-user-login="Aburar_123" class="lia-mention lia-mention-user"&gt;Aburar_123&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1287762" data-lia-user-login="FBergamaschi" class="lia-mention lia-mention-user"&gt;FBergamaschi&lt;/a&gt;&amp;nbsp;and&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; for prompt and helpful responses.&lt;/P&gt;
&lt;P&gt;Just following up to see if the Response provided by community members were helpful in addressing the issue.&lt;/P&gt;
&lt;P&gt;If one of the responses helped resolve your query, please consider marking it as the Accepted Solution. Feel free to reach out if you need any further clarification or assistance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Prasanna Kumar&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 06:08:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4801758#M183701</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-08-20T06:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Query - Time Function - Slow Performance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4804373#M183768</link>
      <description>&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="en-IN"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="624462" data-lia-user-login="Pawel_1990" class="lia-mention lia-mention-user"&gt;Pawel_1990&lt;/a&gt;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="en-IN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="en-IN"&gt;Just following up to see if the Response provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="en-IN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="en-IN"&gt;Best regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="en-IN"&gt;Prasanna Kumar&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 03:25:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4804373#M183768</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-08-22T03:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Query - Time Function - Slow Performance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4806613#M183844</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="624462" data-lia-user-login="Pawel_1990" class="lia-mention lia-mention-user"&gt;Pawel_1990&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just following up to see if the Response provided by community members were helpful in addressing the issue.&lt;/P&gt;
&lt;P&gt;If one of the responses helped resolve your query, please consider marking it as the Accepted Solution. Feel free to reach out if you need any further clarification or assistance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Prasanna Kumar&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 09:56:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4806613#M183844</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-08-25T09:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Query - Time Function - Slow Performance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4811485#M183996</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Topic may be closed, biggest issue was with masking at snowflake level - my other topic:&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/SnowFlake-Direct-Query-Slow-Perfomrance-Adding-Role-at-Power/m-p/4811141#M1430972" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/SnowFlake-Direct-Query-Slow-Perfomrance-Adding-Role-at-Power/m-p/4811141#M1430972&lt;/A&gt;&lt;BR /&gt;When solving this issue, metric started to work correctly again. Thanks all for help, learned a lot.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 10:36:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Direct-Query-Time-Function-Slow-Performance/m-p/4811485#M183996</guid>
      <dc:creator>Pawel_1990</dc:creator>
      <dc:date>2025-08-29T10:36:56Z</dc:date>
    </item>
  </channel>
</rss>

