<?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: DAX for Rolling Count of Records over the time window, with results on a record level in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4302594#M170835</link>
    <description>&lt;P&gt;Thank you Leroy Lu&lt;BR /&gt;Unfortunately, the query reaches the memory limit on my model (1024MB). A View might be my option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd have the last question – anyone&amp;nbsp;knows if a similar result can be achieved by writing DAX as a Visual Calculation? The visual could be filtered to one day only, understand it will be the rolling count would be limited to that day only.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2024 16:37:05 GMT</pubDate>
    <dc:creator>Gosia_Gr</dc:creator>
    <dc:date>2024-11-26T16:37:05Z</dc:date>
    <item>
      <title>DAX for Rolling Count of Records over the time window, with results on a record level</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4295321#M170486</link>
      <description>&lt;P&gt;Hi, I'd need some help with DAX that will return Rolling Count of Records over +/-15min time window, including current record with results on a record level.&lt;BR /&gt;I’m working in DirectQuery mode. I am not sure which would work better regarding performance - a new Measure or a new Table.&lt;BR /&gt;I simplified the table to a minimum.&lt;BR /&gt;Let’s call it FactTable. It has a column with IDs: RecordId, they are unique and not in any order. Each record has its Date Time Stamp: column DateTime.&lt;BR /&gt;DAX should calculate Rolling Count of Record IDs in a way that when I pull Table visual with RecordID, DateTime and Rolling count - all record level information from FactTable is retained:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Not sure if needed here, the original model has Date and Time dimension tables linked by DateKey and TimeKey to the FactTable.&lt;BR /&gt;Time dimension table has: TimeKey, Time, Minute, Hour. Date dimension table has: DateKey, Date, Month, ect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 12:44:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4295321#M170486</guid>
      <dc:creator>Gosia_Gr</dc:creator>
      <dc:date>2024-11-21T12:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Rolling Count of Records over the time window, with results on a record level</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4295740#M170511</link>
      <description>&lt;P&gt;Can you explain how you have a count of 15 &amp;amp; 16 for the first two rows ?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 17:29:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4295740#M170511</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-11-21T17:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Rolling Count of Records over the time window, with results on a record level</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4297023#M170594</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Sachin&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sorry, I forgot to mention. There are more records on 24/11/2024, the table it just a snapshot - the calculation in 1st and 2nd row is counting records before 22/11/2024 22:50. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The whole model has roughly 350 records per day, starting from 2019.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DAX calculation should be continuously rolling, over midnight records as well, i.e. not starting count for each day.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your help&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Gosia&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2024 10:26:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4297023#M170594</guid>
      <dc:creator>Gosia_Gr</dc:creator>
      <dc:date>2024-11-22T10:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Rolling Count of Records over the time window, with results on a record level</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4301753#M170809</link>
      <description>&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Thanks for the reply from SachinNandanwar&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="851577" data-lia-user-login="Gosia_Gr" class="lia-mention lia-mention-user"&gt;Gosia_Gr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Regarding the issue you raised, my solution is as follows:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;1.First I have created the following table and the column names and data are the data you have given:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;2. Below are the measure I've created for your needs:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rolling count =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        DATEDIFF ( 'Table'[DateTime], MAX ( 'Table'[DateTime] ), MINUTE ) &amp;lt;= 15
    )
)
&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;3.Here's my final result, which I hope meets your requirements.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;If you have any questions, please refer to the attached PBIX file. It is important to note that although my data connection mode is set to Import, it has already been tested in DirectQuery. Since DirectQuery requires a connection to the data source, I uploaded it using the Import method.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider Accept it &lt;EM&gt;&lt;STRONG&gt;as the solution &lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 08:55:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4301753#M170809</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-26T08:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Rolling Count of Records over the time window, with results on a record level</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4302594#M170835</link>
      <description>&lt;P&gt;Thank you Leroy Lu&lt;BR /&gt;Unfortunately, the query reaches the memory limit on my model (1024MB). A View might be my option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd have the last question – anyone&amp;nbsp;knows if a similar result can be achieved by writing DAX as a Visual Calculation? The visual could be filtered to one day only, understand it will be the rolling count would be limited to that day only.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 16:37:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4302594#M170835</guid>
      <dc:creator>Gosia_Gr</dc:creator>
      <dc:date>2024-11-26T16:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Rolling Count of Records over the time window, with results on a record level</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4303711#M170883</link>
      <description>&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="851577" data-lia-user-login="Gosia_Gr" class="lia-mention lia-mention-user"&gt;Gosia_Gr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;Thank you for your prompt response.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;1.Firstly, regarding the query limitation issue, you might consider adjusting the query limits and optimising the queries and data model.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;For further details, please refer to:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-set-visual-query-limits" target="_blank"&gt;&lt;SPAN&gt;Set visual query limits in Power BI Desktop - Power BI | Microsoft Learn&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://blog.crossjoin.co.uk/2020/01/20/visual-has-exceeded-the-available-resources-error-power-bi/" target="_blank"&gt;&lt;SPAN&gt;Chris Webb's BI Blog: The “Visual Has Exceeded The Available Resources” Error In Power BI&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;2.Secondly, about replicating the DAX I provided within Visual Calculation, based on my practical tests, it is currently not feasible due to the need for filtering. I have not found an effective solution for this yet.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;For further details, please refer to:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-visual-calculations-overview" target="_blank"&gt;&lt;SPAN&gt;Using visual calculations in Power BI Desktop - Power BI | Microsoft Learn&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;3.Finally, for limiting to just one day, you can directly use the built-in date slicer:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/slicer-filter-relative-time" target="_blank"&gt;&lt;SPAN&gt;Create a relative time slicer or filter in Power BI - Power BI | Microsoft Learn&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;Of course, if you have any new discoveries or questions, please feel free to get in touch with us.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider Accept it &lt;EM&gt;&lt;STRONG&gt;as the solution &lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 08:24:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4303711#M170883</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-27T08:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Rolling Count of Records over the time window, with results on a record level</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4304504#M170927</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Leroy Lu, thank you for the comprehensive response and the links to relevant sources with additional info.&lt;/P&gt;&lt;P&gt;Gosia&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 15:38:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Rolling-Count-of-Records-over-the-time-window-with/m-p/4304504#M170927</guid>
      <dc:creator>Gosia_Gr</dc:creator>
      <dc:date>2024-11-27T15:38:41Z</dc:date>
    </item>
  </channel>
</rss>

