<?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: Average days an event is open over the previous 12 months (this is rolling as the year progresses). in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127250#M163899</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;BR /&gt;&lt;BR /&gt;This solution is counting the number of tickets in a time frame, what I need to do is average&amp;nbsp;the number of days open on each day (on a rolling basis) so I am not sure it will work the same.&lt;BR /&gt;&lt;BR /&gt;I need to work out the avarage&amp;nbsp;days open on a given day for each event - so can this be used in the last VAR instead of a COUNTXX ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Output =&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Test = 

VARTmpTickets = ADDCOLUMNS(
    CAR , 
    "Effective Date" , 
    IF(
       ISBLANK( CAR[Completion Date] ),
        TODAY(),
        CAR[Completion Date]
    )
)
VARTmpTable = SELECTCOLUMNS(
    FILTER(
        GENERATE(
           TmpTickets,
            'Calendar'
        ),
        AND(
        [Date] &amp;gt;= CAR[Audit Conducted Date] &amp;amp;&amp;amp; [Date] &amp;lt;= [Effective Date],
        NOT( CAR[Audit Conducted Date] = [Effective Date] )
        )
    ),
    CARID", CAR[CAR ID],
    "Date", [Date]
)

VARTmpTable1 = GROUPBY(
   TmpTable,CARID], 
    "Count",COUNTX(CURRENTGROUP(), [Date] )
)
RETURN

COUNTROWS(TmpTable1 )&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2024 16:07:32 GMT</pubDate>
    <dc:creator>DemoFour</dc:creator>
    <dc:date>2024-08-30T16:07:32Z</dc:date>
    <item>
      <title>Average days an event is open over the previous 12 months (this is rolling as the year progresses).</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127188#M163895</link>
      <description>&lt;P&gt;Hay everyone,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a request to duplicate a visual the customer creates in excel into a report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;The customer would like a line chart with the Average Days an Event is Open on the Y axis and the month on the X axis - the month needs to advance as the year progresses.&amp;nbsp; (The chart today will show August 2023 to August 2024 next month it will show Sep 2023 - Sep 24) There will also be a secondary line with the metric of days that the Event should be Open (90 days).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Data Model&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;There are in my mini model 3 tables Audit , Action and Date&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Some sample data&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Audit&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Audit ID&lt;/TD&gt;&lt;TD&gt;Date Raised&lt;/TD&gt;&lt;TD&gt;new_projectfunction&lt;/TD&gt;&lt;TD&gt;Audit Conducted Date&lt;/TD&gt;&lt;TD&gt;CAR Required&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;57&lt;/TD&gt;&lt;TD&gt;22/05/2024&lt;/TD&gt;&lt;TD&gt;100000032&lt;/TD&gt;&lt;TD&gt;22/05/2024&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;58&lt;/TD&gt;&lt;TD&gt;29/05/2024&lt;/TD&gt;&lt;TD&gt;100000040&lt;/TD&gt;&lt;TD&gt;02/05/2024&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;59&lt;/TD&gt;&lt;TD&gt;04/06/2024&lt;/TD&gt;&lt;TD&gt;100000004&lt;/TD&gt;&lt;TD&gt;09/05/2024&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;24/06/2024&lt;/TD&gt;&lt;TD&gt;100000032&lt;/TD&gt;&lt;TD&gt;11/06/2024&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61&lt;/TD&gt;&lt;TD&gt;30/06/2024&lt;/TD&gt;&lt;TD&gt;100000032&lt;/TD&gt;&lt;TD&gt;30/06/2024&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;62&lt;/TD&gt;&lt;TD&gt;17/07/2024&lt;/TD&gt;&lt;TD&gt;100000040&lt;/TD&gt;&lt;TD&gt;17/07/2024&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;63&lt;/TD&gt;&lt;TD&gt;29/07/2024&lt;/TD&gt;&lt;TD&gt;100000032&lt;/TD&gt;&lt;TD&gt;29/07/2024&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;64&lt;/TD&gt;&lt;TD&gt;30/07/2024&lt;/TD&gt;&lt;TD&gt;100000032&lt;/TD&gt;&lt;TD&gt;16/06/2024&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;65&lt;/TD&gt;&lt;TD&gt;12/08/2024&lt;/TD&gt;&lt;TD&gt;100000040&lt;/TD&gt;&lt;TD&gt;12/08/2024&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Actions&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Audit ID&lt;/TD&gt;&lt;TD&gt;Audit Conducted Date&lt;/TD&gt;&lt;TD&gt;CAR Due Date&lt;/TD&gt;&lt;TD&gt;Completion Date&lt;/TD&gt;&lt;TD&gt;CAR Category&lt;/TD&gt;&lt;TD&gt;Standards Name&lt;/TD&gt;&lt;TD&gt;Standards Clauses&lt;/TD&gt;&lt;TD&gt;CAR Status&lt;/TD&gt;&lt;TD&gt;Days CAR Open&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;57&lt;/TD&gt;&lt;TD&gt;22/05/2024&lt;/TD&gt;&lt;TD&gt;22/08/2024&lt;/TD&gt;&lt;TD&gt;25/06/2024&lt;/TD&gt;&lt;TD&gt;Major&lt;/TD&gt;&lt;TD&gt;ISO 9001&lt;/TD&gt;&lt;TD&gt;7.5 Documented information&lt;/TD&gt;&lt;TD&gt;Closed&lt;/TD&gt;&lt;TD&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;57&lt;/TD&gt;&lt;TD&gt;22/05/2024&lt;/TD&gt;&lt;TD&gt;22/08/2024&lt;/TD&gt;&lt;TD&gt;19/08/2024&lt;/TD&gt;&lt;TD&gt;Major&lt;/TD&gt;&lt;TD&gt;ISO 9001&lt;/TD&gt;&lt;TD&gt;7.5 Documented information&lt;/TD&gt;&lt;TD&gt;Closed&lt;/TD&gt;&lt;TD&gt;89&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;57&lt;/TD&gt;&lt;TD&gt;22/05/2024&lt;/TD&gt;&lt;TD&gt;29/06/2024&lt;/TD&gt;&lt;TD&gt;24/06/2024&lt;/TD&gt;&lt;TD&gt;Major&lt;/TD&gt;&lt;TD&gt;ISO 9001&lt;/TD&gt;&lt;TD&gt;7.5 Documented information&lt;/TD&gt;&lt;TD&gt;Closed&lt;/TD&gt;&lt;TD&gt;33&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;11/06/2024&lt;/TD&gt;&lt;TD&gt;15/09/2024&lt;/TD&gt;&lt;TD&gt;08/07/2024&lt;/TD&gt;&lt;TD&gt;SFI&lt;/TD&gt;&lt;TD&gt;ISO 9001&lt;/TD&gt;&lt;TD&gt;7.5 Documented information&lt;/TD&gt;&lt;TD&gt;Closed&lt;/TD&gt;&lt;TD&gt;27&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;61&lt;/TD&gt;&lt;TD&gt;30/06/2024&lt;/TD&gt;&lt;TD&gt;01/01/2025&lt;/TD&gt;&lt;TD&gt;30/06/2024&lt;/TD&gt;&lt;TD&gt;SFI&lt;/TD&gt;&lt;TD&gt;ISO 9001&lt;/TD&gt;&lt;TD&gt;9.2 Internal audit&lt;/TD&gt;&lt;TD&gt;Closed&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;62&lt;/TD&gt;&lt;TD&gt;17/07/2024&lt;/TD&gt;&lt;TD&gt;15/08/2024&lt;/TD&gt;&lt;TD&gt;21/08/2024&lt;/TD&gt;&lt;TD&gt;Major&lt;/TD&gt;&lt;TD&gt;ISO 45001&lt;/TD&gt;&lt;TD&gt;8.1 Operational planning and control&lt;/TD&gt;&lt;TD&gt;Closed&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;62&lt;/TD&gt;&lt;TD&gt;17/07/2024&lt;/TD&gt;&lt;TD&gt;15/08/2024&lt;/TD&gt;&lt;TD&gt;21/08/2024&lt;/TD&gt;&lt;TD&gt;Major&lt;/TD&gt;&lt;TD&gt;ISO 45001&lt;/TD&gt;&lt;TD&gt;8.1 Operational planning and control&lt;/TD&gt;&lt;TD&gt;Closed&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;58&lt;/TD&gt;&lt;TD&gt;02/05/2024&lt;/TD&gt;&lt;TD&gt;03/11/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Minor&lt;/TD&gt;&lt;TD&gt;ISO 14001&lt;/TD&gt;&lt;TD&gt;6.2 Environmental objectives and planning to achieve them&lt;/TD&gt;&lt;TD&gt;Open&lt;/TD&gt;&lt;TD&gt;113&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;59&lt;/TD&gt;&lt;TD&gt;09/05/2024&lt;/TD&gt;&lt;TD&gt;10/11/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Minor&lt;/TD&gt;&lt;TD&gt;ISO 14001&lt;/TD&gt;&lt;TD&gt;6.2 Environmental objectives and planning to achieve them&lt;/TD&gt;&lt;TD&gt;Open&lt;/TD&gt;&lt;TD&gt;106&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;11/06/2024&lt;/TD&gt;&lt;TD&gt;15/09/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;SFI&lt;/TD&gt;&lt;TD&gt;ISO 45001&lt;/TD&gt;&lt;TD&gt;8.1 Operational planning and control&lt;/TD&gt;&lt;TD&gt;Open&lt;/TD&gt;&lt;TD&gt;73&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;63&lt;/TD&gt;&lt;TD&gt;29/07/2024&lt;/TD&gt;&lt;TD&gt;30/10/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Minor&lt;/TD&gt;&lt;TD&gt;ISO 9001&lt;/TD&gt;&lt;TD&gt;8.2 Requirements for products and services&lt;/TD&gt;&lt;TD&gt;Open&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;64&lt;/TD&gt;&lt;TD&gt;16/06/2024&lt;/TD&gt;&lt;TD&gt;26/09/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Minor&lt;/TD&gt;&lt;TD&gt;ISO 14001&lt;/TD&gt;&lt;TD&gt;9.1 Monitoring, measurement, analysis, and evaluation&lt;/TD&gt;&lt;TD&gt;Open&lt;/TD&gt;&lt;TD&gt;68&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Date table is your standard date table built in M at a day per year = 365 with all the normal columns you need.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is One Audit to Many (&lt;EM&gt;N&lt;/EM&gt;&amp;nbsp;) CARs attached to each audit.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The date table is currently linked to the Audit Completed date but there are inactive relationships to Completion Date and Due Date but not being used in this instance.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In the full model there are many dimensions&amp;nbsp;for Staff and Projects etc., that the report is using.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can easily find the average&amp;nbsp;days open for each Audit using AVERAGEX and iterating the total days by the ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ave days open CAR ID = 
AVERAGEX(
   VALUES( CAR[CAR ID] ),
    [Total Days CAR Open] 
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;I issue is that the visual is then totaling these by the conducted date and not giving the correct result as a rolling total each month, it is fixing them to the conducted date in the filter context from the date table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I think that what I need to do is build a table that takes the start date - then counts a running total of each day until it finishes - and then have these values in the line chart by the date as a moving total as time goes by with the dates for each date from the start date to the end dates.&amp;nbsp; I have built this in M to see what it looks like and as a virtual table but, I cannot make the leap to get the visual to match the above example.&amp;nbsp; - the customer manually builds this each month with raw totals and months calculated and then tunred into the graph.&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What the customer has done in Excel is easy as there placing each total value for the CAR in the table each month and producing the graph then changing the totals and the dates each month to make a new chart, but this is not how a semantic model works, this is the last piece of the puzzle and my brain hurts on a Friday sunny afternoon, so I think I am over thinking this and making it complicated!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any new thoughts would be a great help as my VAR virtual tables and DAX is getting longer and longer as I think about this problem and do not solve it!&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any help greatly welcome.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 15:08:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127188#M163895</guid>
      <dc:creator>DemoFour</dc:creator>
      <dc:date>2024-08-30T15:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Average days an event is open over the previous 12 months (this is rolling as the year progresses).</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127192#M163896</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82804" data-lia-user-login="DemoFour" class="lia-mention lia-mention-user"&gt;DemoFour&lt;/a&gt;&amp;nbsp;I think you need something like this:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364#M147" target="_blank"&gt;Open Tickets - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 15:12:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127192#M163896</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-08-30T15:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Average days an event is open over the previous 12 months (this is rolling as the year progresses).</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127196#M163897</link>
      <description>&lt;P&gt;Thanks&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;&lt;BR /&gt;Will give that a go &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 15:14:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127196#M163897</guid>
      <dc:creator>DemoFour</dc:creator>
      <dc:date>2024-08-30T15:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Average days an event is open over the previous 12 months (this is rolling as the year progresses).</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127250#M163899</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;BR /&gt;&lt;BR /&gt;This solution is counting the number of tickets in a time frame, what I need to do is average&amp;nbsp;the number of days open on each day (on a rolling basis) so I am not sure it will work the same.&lt;BR /&gt;&lt;BR /&gt;I need to work out the avarage&amp;nbsp;days open on a given day for each event - so can this be used in the last VAR instead of a COUNTXX ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Output =&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Test = 

VARTmpTickets = ADDCOLUMNS(
    CAR , 
    "Effective Date" , 
    IF(
       ISBLANK( CAR[Completion Date] ),
        TODAY(),
        CAR[Completion Date]
    )
)
VARTmpTable = SELECTCOLUMNS(
    FILTER(
        GENERATE(
           TmpTickets,
            'Calendar'
        ),
        AND(
        [Date] &amp;gt;= CAR[Audit Conducted Date] &amp;amp;&amp;amp; [Date] &amp;lt;= [Effective Date],
        NOT( CAR[Audit Conducted Date] = [Effective Date] )
        )
    ),
    CARID", CAR[CAR ID],
    "Date", [Date]
)

VARTmpTable1 = GROUPBY(
   TmpTable,CARID], 
    "Count",COUNTX(CURRENTGROUP(), [Date] )
)
RETURN

COUNTROWS(TmpTable1 )&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 16:07:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127250#M163899</guid>
      <dc:creator>DemoFour</dc:creator>
      <dc:date>2024-08-30T16:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Average days an event is open over the previous 12 months (this is rolling as the year progresses).</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127408#M163914</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82804" data-lia-user-login="DemoFour" class="lia-mention lia-mention-user"&gt;DemoFour&lt;/a&gt;&amp;nbsp;Correct, in your case you would need to modify the measure so that after you work out the effective date you would then need to add a column that calculated the number of days from the date opened to the effective date. You can use simple math to do this ( [effective date] - [opened date] ) * 1. for example. Once you have that, then you would need to do an AVERAGEX across the table for that column.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 17:53:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4127408#M163914</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-08-30T17:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Average days an event is open over the previous 12 months (this is rolling as the year progresses).</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4129790#M164026</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; Can you post up an example please as I am not getting a cohent return value&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 15:29:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-days-an-event-is-open-over-the-previous-12-months-this/m-p/4129790#M164026</guid>
      <dc:creator>DemoFour</dc:creator>
      <dc:date>2024-09-02T15:29:33Z</dc:date>
    </item>
  </channel>
</rss>

