<?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: How to get downtime per day from multiple dates? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-downtime-per-day-from-multiple-dates/m-p/4021360#M158660</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Duration Time 2 = 
SUMX(
    VALUES('Date'[Date]),
    VAR CurrentDay = 'Date'[Date]
    VAR DayStart = CurrentDay
    VAR DayEnd = DayStart + TIME(23, 59, 59)
    VAR OverlappingEvents = 
        FILTER(
            'Table',
            'Table'[Start] &amp;lt;= DayEnd &amp;amp;&amp;amp;
            'Table'[End] &amp;gt;= DayStart
        )
    VAR TotalDowntimeInSeconds =
        SUMX(
            OverlappingEvents,
            DATEDIFF(
                MAX(DayStart, 'Table'[Start]),
                MIN(DayEnd, 'Table'[End]),
                SECOND
            )
        )
    RETURN
        TotalDowntimeInSeconds / 60 -- Convert seconds to minutes
)&lt;/LI-CODE&gt;&lt;P&gt;Once you have created this measure, you can use it in your BciCalendar visual to show the downtime for each day, correctly accounting for downtimes that span multiple days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hackcrr&lt;/P&gt;&lt;P&gt;If this post helps, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;kudos to this post&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2024 23:17:25 GMT</pubDate>
    <dc:creator>hackcrr</dc:creator>
    <dc:date>2024-07-02T23:17:25Z</dc:date>
    <item>
      <title>How to get downtime per day from multiple dates?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-downtime-per-day-from-multiple-dates/m-p/3997771#M155474</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I want to create a calendar with the &lt;STRONG&gt;BciCalendar visual&lt;/STRONG&gt;, showing each day's downtime. The thing is, I have multiple events with &lt;STRONG&gt;downtime that can exceed 1440&lt;/STRONG&gt; minutes (24 hours). I found the measure I need from another answer:&lt;BR /&gt;(&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-downtime-per-day-when-there-are-multiple-days-between/m-p/3090572" target="_blank" rel="noopener"&gt;How to get downtime per day when there are multiple days between start and end date?&lt;/A&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Duration Time 2 = 
SUMX ( 
    VALUES ( 'Date'[Date] ),
    VAR CurrentStartTime = 'Date'[Date]
    VAR CurrentEndTime = CurrentStartTime + TIME ( 23, 59, 59 )
    VAR FilteredTable = FILTER ( 'Table', CurrentStartTime IN CALENDAR ( 'Table'[Start].[Date], 'Table'[End].[Date] ) )
    RETURN
        SUMX (
            FilteredTable,
            DATEDIFF ( MAX ( CurrentStartTime, 'Table'[Start] ), MIN ( CurrentEndTime, 'Table'[End] ), SECOND )
        )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But now, when I use the measure, it reduces the downtime only for the first day when the event starts (just first 1440 minutes). For the rest of the days, the downtime stops being counted.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;How can I make it show the downtime from the event for each day until it has been completed?&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Thanks for support! I'm a powerBI beginner.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 08:16:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-downtime-per-day-from-multiple-dates/m-p/3997771#M155474</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-18T08:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get downtime per day from multiple dates?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-downtime-per-day-from-multiple-dates/m-p/3999019#M155695</link>
      <description>&lt;P&gt;Use a more appropriate visual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 23:57:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-downtime-per-day-from-multiple-dates/m-p/3999019#M155695</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-06-18T23:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get downtime per day from multiple dates?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-downtime-per-day-from-multiple-dates/m-p/4021360#M158660</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Duration Time 2 = 
SUMX(
    VALUES('Date'[Date]),
    VAR CurrentDay = 'Date'[Date]
    VAR DayStart = CurrentDay
    VAR DayEnd = DayStart + TIME(23, 59, 59)
    VAR OverlappingEvents = 
        FILTER(
            'Table',
            'Table'[Start] &amp;lt;= DayEnd &amp;amp;&amp;amp;
            'Table'[End] &amp;gt;= DayStart
        )
    VAR TotalDowntimeInSeconds =
        SUMX(
            OverlappingEvents,
            DATEDIFF(
                MAX(DayStart, 'Table'[Start]),
                MIN(DayEnd, 'Table'[End]),
                SECOND
            )
        )
    RETURN
        TotalDowntimeInSeconds / 60 -- Convert seconds to minutes
)&lt;/LI-CODE&gt;&lt;P&gt;Once you have created this measure, you can use it in your BciCalendar visual to show the downtime for each day, correctly accounting for downtimes that span multiple days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hackcrr&lt;/P&gt;&lt;P&gt;If this post helps, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;kudos to this post&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 23:17:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-downtime-per-day-from-multiple-dates/m-p/4021360#M158660</guid>
      <dc:creator>hackcrr</dc:creator>
      <dc:date>2024-07-02T23:17:25Z</dc:date>
    </item>
  </channel>
</rss>

