<?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 Split Rows for Entries Greater Than 24 Hours in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-Rows-for-Entries-Greater-Than-24-Hours/m-p/2603434#M75327</link>
    <description>&lt;P&gt;Hello Together,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;imagine I have the following table consisting of start times and end times where one entry is larger than 24 hours (here 48 hours):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I cut this entry in this case into 3 entries for each day such that I have:&lt;/P&gt;&lt;P&gt;1) 11.06.2022 06:00:00 - 11.06.2022 23:59:59&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;12.06.2022 00:00:00 - 12.06.2022 23:59:59&lt;/P&gt;&lt;P&gt;3) 13.06.2022 00:00:00 - 11.06.2022 06:00:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help, I really appreciate it!&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2022 08:47:23 GMT</pubDate>
    <dc:creator>Fabi_Rntmn</dc:creator>
    <dc:date>2022-06-27T08:47:23Z</dc:date>
    <item>
      <title>Split Rows for Entries Greater Than 24 Hours</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-Rows-for-Entries-Greater-Than-24-Hours/m-p/2603434#M75327</link>
      <description>&lt;P&gt;Hello Together,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;imagine I have the following table consisting of start times and end times where one entry is larger than 24 hours (here 48 hours):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I cut this entry in this case into 3 entries for each day such that I have:&lt;/P&gt;&lt;P&gt;1) 11.06.2022 06:00:00 - 11.06.2022 23:59:59&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;12.06.2022 00:00:00 - 12.06.2022 23:59:59&lt;/P&gt;&lt;P&gt;3) 13.06.2022 00:00:00 - 11.06.2022 06:00:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help, I really appreciate it!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 08:47:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-Rows-for-Entries-Greater-Than-24-Hours/m-p/2603434#M75327</guid>
      <dc:creator>Fabi_Rntmn</dc:creator>
      <dc:date>2022-06-27T08:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Split Rows for Entries Greater Than 24 Hours</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-Rows-for-Entries-Greater-Than-24-Hours/m-p/2604864#M75392</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="405875" data-lia-user-login="Fabi_Rntmn" class="lia-mention lia-mention-user"&gt;Fabi_Rntmn&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;This is a bet complex. Please refer to sample file with the solution&amp;nbsp;&lt;A href="https://we.tl/t-rgdc467UOW" target="_blank"&gt;https://we.tl/t-rgdc467UOW&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;New Data = 
VAR T1 =
    GENERATE (
        Data,
        VAR StartTime = Data[StartTime]
        VAR EndTime = Data[EndTime]
        VAR StartDate = DATE ( YEAR ( StartTime ), MONTH ( StartTime ), DAY ( StartTime ) )
        VAR EndDate = DATE ( YEAR ( EndTime ), MONTH ( EndTime ), DAY ( EndTime ) )
        VAR HoursToAdd = TIME ( 23, 59, 59 )
        RETURN
            ADDCOLUMNS (
                CALENDAR ( StartTime, EndTime ),
                "@NewStartTime", IF ( [Date] = StartDate, StartTime, [Date] ),
                "@NewEndTime", IF ( [Date] = EndDate, EndTime, [Date] + HoursToAdd )
            )
    )
RETURN
    SELECTCOLUMNS (
        T1,
        "Start Time", [@NewStartTime],
        "End Time", [@NewEndTime],
        "Time Difference", 
            DIVIDE ( 
                DATEDIFF ( [@NewStartTime], [@NewEndTime], SECOND ), 
                3600 
            )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 17:46:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-Rows-for-Entries-Greater-Than-24-Hours/m-p/2604864#M75392</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-06-27T17:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Split Rows for Entries Greater Than 24 Hours</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-Rows-for-Entries-Greater-Than-24-Hours/m-p/2606017#M75456</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&lt;BR /&gt;Thank you so much for your quick help! This worked quite well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 08:00:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-Rows-for-Entries-Greater-Than-24-Hours/m-p/2606017#M75456</guid>
      <dc:creator>Fabi_Rntmn</dc:creator>
      <dc:date>2022-06-28T08:00:00Z</dc:date>
    </item>
  </channel>
</rss>

