<?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: Display time over 24 hours in Power BI in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2692998#M82829</link>
    <description>&lt;P&gt;Hello Vijay,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the formula but&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's still the same problem when the time bleeds over past 12 am into the next day&lt;/P&gt;&lt;P&gt;I would also like to create a new date time that correctly shows the next day for these records. I just merged the date and the end date because I didn't now how to create and end date column and time column any other way.&amp;nbsp;&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;</description>
    <pubDate>Wed, 10 Aug 2022 15:41:56 GMT</pubDate>
    <dc:creator>Dallas7890</dc:creator>
    <dc:date>2022-08-10T15:41:56Z</dc:date>
    <item>
      <title>Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2692423#M82807</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I'm having a little challenge in a simple table trying to calculate the time passed, for example from 22:00 to 2:00 in the morning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I have tried this code to calculate the Duration in Minutes it works as long as the times are on the same day, otherwise, it gives me a negative minutes.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I would also like to ask power bi to change the Shift end Date to the next day if it goes past midnight.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I am hoping someone can help me.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 12:00:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2692423#M82807</guid>
      <dc:creator>Dallas7890</dc:creator>
      <dc:date>2022-08-10T12:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2692902#M82825</link>
      <description>&lt;P&gt;Use below formula for minutes calculation&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Duration in Mintes = ([Shift end Date]-[Shift start Date])*1440&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 15:04:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2692902#M82825</guid>
      <dc:creator>Vijay_A_Verma</dc:creator>
      <dc:date>2022-08-10T15:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2692998#M82829</link>
      <description>&lt;P&gt;Hello Vijay,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the formula but&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's still the same problem when the time bleeds over past 12 am into the next day&lt;/P&gt;&lt;P&gt;I would also like to create a new date time that correctly shows the next day for these records. I just merged the date and the end date because I didn't now how to create and end date column and time column any other way.&amp;nbsp;&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;</description>
      <pubDate>Wed, 10 Aug 2022 15:41:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2692998#M82829</guid>
      <dc:creator>Dallas7890</dc:creator>
      <dc:date>2022-08-10T15:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693054#M82831</link>
      <description>&lt;P&gt;The shift can't end before the shift starts. This issue will lead to data inconsistency.&lt;/P&gt;&lt;P&gt;Assuming the intention to put this data is correct, then you can use below formula&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=ABS([Shift start Date]-[Shift end Date])*1440&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 10 Aug 2022 16:03:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693054#M82831</guid>
      <dc:creator>Vijay_A_Verma</dc:creator>
      <dc:date>2022-08-10T16:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693164#M82833</link>
      <description>&lt;P&gt;Hi Vijay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't have a Start Datetime or End Datetime column to work with. I had to try and create these columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the only data&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;DIV class=""&gt;That is the beginning of my problem. I didn't have a start date/time column or End date/time. I tried to create both columns using power query using the column merge with a space. Using the Date and Start and then the Date and End. This end column isn't correct for the ones that are past 12 am should go to the next day.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;If I could create a good End Date Time column, using the Hours but I didn't know how to do that.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Would you know how I can do that?&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Thank you kindly for your help&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 Aug 2022 16:51:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693164#M82833</guid>
      <dc:creator>Dallas7890</dc:creator>
      <dc:date>2022-08-10T16:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693202#M82834</link>
      <description>&lt;P&gt;It looks like that your shift ends next day. You will need to create Start Datetime and End Datetime like these in PQ&lt;/P&gt;&lt;P&gt;=[Date]&amp;amp;[Start]&lt;/P&gt;&lt;P&gt;=Date.AddDays([Date],1)&amp;amp;[Start]&lt;/P&gt;&lt;P&gt;Then in PQ, you can use following formula for Total Minutes&lt;/P&gt;&lt;P&gt;= Duration.TotalMinutes([EndDateTime]-[StartDateTime])&lt;/P&gt;&lt;P&gt;See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTUNzIAIiNDJR0gx8rE1MrAQCHAF8izALJAHEdfpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Start = _t, End = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Start", type time}, {"End", type time}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "StartDateTime", each [Date]&amp;amp;[Start], type datetime),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "EndDateTime", each Date.AddDays([Date],1)&amp;amp;[End]),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "TotalMinutes", each Duration.TotalMinutes([EndDateTime]-[StartDateTime]))
in
    #"Added Custom2"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 10 Aug 2022 17:09:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693202#M82834</guid>
      <dc:creator>Vijay_A_Verma</dc:creator>
      <dc:date>2022-08-10T17:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693247#M82837</link>
      <description>&lt;P&gt;Hi Vijay,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This formula works perfectly except for some really do end on the same day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to tell the formula that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what it looks like now using your amazing formula&lt;/P&gt;&lt;P&gt;The only problem if you see some are really starting at 6:30 am and ending on the same day shift at 4:30 pm&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank again for helping me with this.&lt;/P&gt;&lt;P&gt;Much appreciated.&amp;nbsp;&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;</description>
      <pubDate>Wed, 10 Aug 2022 17:38:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693247#M82837</guid>
      <dc:creator>Dallas7890</dc:creator>
      <dc:date>2022-08-10T17:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693263#M82840</link>
      <description>&lt;P&gt;The formula for End DateTime will need to be changed to&lt;/P&gt;&lt;P&gt;if [End]&amp;gt;=[Start] then [Date]&amp;amp;[End] else Date.AddDays([Date],1)&amp;amp;[End]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTUNzIAIiNDJR0gx8rE1MrAQCHAF8izALJAHEdfpVgdiEojmEoDEytjmCRQnwGUB9QXGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Start = _t, End = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Start", type time}, {"End", type time}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "StartDateTime", each [Date]&amp;amp;[Start], type datetime),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "EndDateTime", each if [End]&amp;gt;[Start] then [Date]&amp;amp;[End] else Date.AddDays([Date],1)&amp;amp;[End]),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "TotalMinutes", each Duration.TotalMinutes([EndDateTime]-[StartDateTime]))
in
    #"Added Custom2"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 17:49:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693263#M82840</guid>
      <dc:creator>Vijay_A_Verma</dc:creator>
      <dc:date>2022-08-10T17:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693265#M82841</link>
      <description>&lt;P&gt;Here is a better look. For example, some really do start and end on the same shift&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example the start at 7:00:00 AM should still end on the same day 4/1/2021 at 8:00:00pm&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also the 12:00 AM to 12:00: AM should all just remain as the same day&lt;/P&gt;&lt;P&gt;No time was really worked on these days&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;</description>
      <pubDate>Wed, 10 Aug 2022 17:48:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693265#M82841</guid>
      <dc:creator>Dallas7890</dc:creator>
      <dc:date>2022-08-10T17:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693271#M82842</link>
      <description>&lt;P&gt;Replacing End Date time with this formula will solve the problem&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if [End]&amp;gt;=[Start] then [Date]&amp;amp;[End] else Date.AddDays([Date],1)&amp;amp;[End]&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 17:51:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693271#M82842</guid>
      <dc:creator>Vijay_A_Verma</dc:creator>
      <dc:date>2022-08-10T17:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Display time over 24 hours in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693351#M82846</link>
      <description>&lt;P&gt;Thank you so much, Vijay. The formula worked perfectly&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 19:06:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Display-time-over-24-hours-in-Power-BI/m-p/2693351#M82846</guid>
      <dc:creator>Dallas7890</dc:creator>
      <dc:date>2022-08-10T19:06:39Z</dc:date>
    </item>
  </channel>
</rss>

