<?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: Hour Duration between two different rows from different columns in Power BI in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3714623#M144647</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694011" data-lia-user-login="sushmitasur4" class="lia-mention lia-mention-user"&gt;sushmitasur4&lt;/a&gt;&amp;nbsp;Cross posted. See answer in other thread.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2024 15:03:22 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2024-02-21T15:03:22Z</dc:date>
    <item>
      <title>Hour Duration between two different rows from different columns in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3714606#M144646</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So I am working with Live Data in POWER BI. I need a Query.&lt;/P&gt;&lt;P&gt;What I really want is the Sum of Hours between (Start time when type = 3) and (End time when type = 3)&lt;/P&gt;&lt;P&gt;Basically, It starts when type = 3 and records the start time. The counter Goes on until type goes back to type = 2 and records the previous row and records the End time and then calculates the Duration between them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Hour Duration column is my desired Output.&lt;/P&gt;&lt;P&gt;Output Explanation:&lt;/P&gt;&lt;P&gt;I subtract the end time&amp;nbsp;23-01-2020 11:39 with the start time of previous row&amp;nbsp;21-01-2020 09:33.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 14:56:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3714606#M144646</guid>
      <dc:creator>sushmitasur4</dc:creator>
      <dc:date>2024-02-21T14:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Hour Duration between two different rows from different columns in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3714623#M144647</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694011" data-lia-user-login="sushmitasur4" class="lia-mention lia-mention-user"&gt;sushmitasur4&lt;/a&gt;&amp;nbsp;Cross posted. See answer in other thread.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 15:03:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3714623#M144647</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-02-21T15:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Hour Duration between two different rows from different columns in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3716288#M144648</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694011" data-lia-user-login="sushmitasur4" class="lia-mention lia-mention-user"&gt;sushmitasur4&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can follow the steps below to get it:&lt;/P&gt;
&lt;P&gt;1. Add index column in Power Query Editor&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;= Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create a &lt;STRONG&gt;calculated column&lt;/STRONG&gt; as below&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
VAR _count =
    CALCULATE (
        COUNT ( 'Table'[Index] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Type] = EARLIER ( 'Table'[Type] )
                &amp;amp;&amp;amp; 'Table'[Index]
                    = EARLIER ( 'Table'[Index] ) - 1
        )
    )
VAR _prestart =
    CALCULATE (
        MAX ( 'Table'[Start] ),
        FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 )
    )
RETURN
    IF ( ISBLANK ( _count ), BLANK (), DATEDIFF ( _prestart, 'Table'[End], HOUR ) )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 07:39:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3716288#M144648</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-22T07:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Hour Duration between two different rows from different columns in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3716672#M144670</link>
      <description>&lt;P&gt;The table below is the reference. The Hour Duration is the expected Output actually.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 09:35:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3716672#M144670</guid>
      <dc:creator>sushmitasur4</dc:creator>
      <dc:date>2024-02-22T09:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Hour Duration between two different rows from different columns in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3718617#M144783</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="694011" data-lia-user-login="sushmitasur4" class="lia-mention lia-mention-user"&gt;sushmitasur4&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Why the Hours Duration is "01:06:00" when Index is 5? Could you please provide the related calculation logic?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 02:36:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3718617#M144783</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-23T02:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Hour Duration between two different rows from different columns in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3730855#M145397</link>
      <description>&lt;P&gt;Here's the Pseudo Code of the logic calculation I need:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BypassedHoursColumn =&lt;/P&gt;&lt;P&gt;When typecolumn = 3: Variable MinTime = Start_TimeStamp&lt;/P&gt;&lt;P&gt;When typecolumn !=3:&lt;/P&gt;&lt;P&gt;IF&amp;nbsp;PreviousRow((End_TimeStamp)) == Non-Blank:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable MaxTime = PreviousRow((End_TimeStamp)) and Store&amp;nbsp;(MaxTime - MinTime)&lt;/P&gt;&lt;P&gt;IF&amp;nbsp;PreviousRow((End_TimeStamp)) == Blank:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable MaxTime = PreviousRow((End_TimeStamp)) and Store (NOW() - MinTime)&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 14:22:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hour-Duration-between-two-different-rows-from-different-columns/m-p/3730855#M145397</guid>
      <dc:creator>sushmitasur4</dc:creator>
      <dc:date>2024-02-28T14:22:38Z</dc:date>
    </item>
  </channel>
</rss>

