<?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 using time intelligence (dates between) inside summarize function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-time-intelligence-dates-between-inside-summarize-function/m-p/4365528#M173335</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;I use this formula to generate table where i have for each date and account from the originl table a new column with last 28 days number of conversations.&lt;/P&gt;&lt;P&gt;table =&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;AI_AUTO_PILOT_WITH_TICKET_INFO,&lt;BR /&gt;DIM_TIME[DATE],&lt;BR /&gt;DIM_ACCOUNT[ACCOUNT_ID],&lt;BR /&gt;"last_28_conv_account",&lt;BR /&gt;CALCULATE(&lt;BR /&gt;DISTINCTCOUNT(AI_AUTO_PILOT_WITH_TICKET_INFO[CONVERSATION_ID]),&lt;BR /&gt;DATESBETWEEN(&lt;BR /&gt;DIM_TIME[DATE],&lt;BR /&gt;MIN(DIM_TIME[DATE]) - 28, -- Use MIN(DIM_TIME[DATE]) to get the current row's date context&lt;BR /&gt;MIN(DIM_TIME[DATE]) - 1 -- The last day before the current row's date&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;why does it returns empty when i use it in a table with date and account columns included?&lt;BR /&gt;when i switch to today() its working but i want it to be related to filter context of date and be evaluated for each date sepratly.&lt;BR /&gt;thank you&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2025 16:57:48 GMT</pubDate>
    <dc:creator>Amir_Meidan</dc:creator>
    <dc:date>2025-01-15T16:57:48Z</dc:date>
    <item>
      <title>using time intelligence (dates between) inside summarize function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-time-intelligence-dates-between-inside-summarize-function/m-p/4365528#M173335</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I use this formula to generate table where i have for each date and account from the originl table a new column with last 28 days number of conversations.&lt;/P&gt;&lt;P&gt;table =&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;AI_AUTO_PILOT_WITH_TICKET_INFO,&lt;BR /&gt;DIM_TIME[DATE],&lt;BR /&gt;DIM_ACCOUNT[ACCOUNT_ID],&lt;BR /&gt;"last_28_conv_account",&lt;BR /&gt;CALCULATE(&lt;BR /&gt;DISTINCTCOUNT(AI_AUTO_PILOT_WITH_TICKET_INFO[CONVERSATION_ID]),&lt;BR /&gt;DATESBETWEEN(&lt;BR /&gt;DIM_TIME[DATE],&lt;BR /&gt;MIN(DIM_TIME[DATE]) - 28, -- Use MIN(DIM_TIME[DATE]) to get the current row's date context&lt;BR /&gt;MIN(DIM_TIME[DATE]) - 1 -- The last day before the current row's date&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;why does it returns empty when i use it in a table with date and account columns included?&lt;BR /&gt;when i switch to today() its working but i want it to be related to filter context of date and be evaluated for each date sepratly.&lt;BR /&gt;thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 16:57:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-time-intelligence-dates-between-inside-summarize-function/m-p/4365528#M173335</guid>
      <dc:creator>Amir_Meidan</dc:creator>
      <dc:date>2025-01-15T16:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: using time intelligence (dates between) inside summarize function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-time-intelligence-dates-between-inside-summarize-function/m-p/4366555#M173373</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="857508" data-lia-user-login="Amir_Meidan" class="lia-mention lia-mention-user"&gt;Amir_Meidan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the modified formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;table = ADDCOLUMNS(
SUMMARIZE(
AI_AUTO_PILOT_WITH_TICKET_INFO,
DIM_TIME[DATE],
DIM_ACCOUNT[ACCOUNT_ID]),
"last_28_conv_account",
VAR _current='DIM_TIME'[Date]
RETURN
CALCULATE(
DISTINCTCOUNT(AI_AUTO_PILOT_WITH_TICKET_INFO[CONVERSATION_ID]),
'AI_AUTO_PILOT_WITH_TICKET_INFO','AI_AUTO_PILOT_WITH_TICKET_INFO'[DATE]&amp;gt;=_current - 28, -- Use MIN(DIM_TIME[DATE]) to get the current row's date context
'AI_AUTO_PILOT_WITH_TICKET_INFO'[DATE]&amp;lt;_current -- The last day before the current row's date
)
)&lt;/LI-CODE&gt;
&lt;P&gt;The ADDCOLUMNS function was used to add a calculated column to the above formula, and a date variable was created to specify the row context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/I&gt;, then please consider&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/I&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2025 06:37:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-time-intelligence-dates-between-inside-summarize-function/m-p/4366555#M173373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-16T06:37:41Z</dc:date>
    </item>
  </channel>
</rss>

