<?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: Minutes worked per hour in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minutes-worked-per-hour/m-p/4021486#M158674</link>
    <description>&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>Wed, 03 Jul 2024 01:36:53 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-07-03T01:36:53Z</dc:date>
    <item>
      <title>Minutes worked per hour</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minutes-worked-per-hour/m-p/4020127#M158591</link>
      <description>&lt;P&gt;Hello folks, I am hoping someone can help me as I've searched forums and wrangled with CoPilot to no avail so far!&lt;BR /&gt;&lt;BR /&gt;I have timesheet data nicely formatted with a START_TIME and END_TIME and needed to show this in a table with NAME and CALENDAR_DAY and then columns from 00 to 23 to shade in when they have worked accross those hours. I have done this part using the DAX:&lt;/P&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;06 =IF(AND(HOUR(Timesheets[START_TIME Floor])&amp;lt;=06,HOUR(Timesheets[END_TIME Ceiling])&amp;gt;06),1,BLANK())&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;(obviously, 06 adjusted to each hour, then conditional formatting to shade a colour where '1')&lt;BR /&gt;&lt;BR /&gt;However, for the Start and End I need to shade a different colour if they don't start/end right on the hour. I thought the best way is to amend the DAX above to just show the number of minutes worked per hour and apply conditoinal formatting to that instead. But I can't get this to work.&lt;BR /&gt;&lt;BR /&gt;I used this DAX:&lt;EM&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;07 =&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;SUMX(&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; FILTER(&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Timesheets,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Timesheets[START_TIME Revised] &amp;lt; TIME(8, 0, 0) &amp;amp;&amp;amp; Timesheets[END_TIME Revised] &amp;gt; TIME(7, 0, 0)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; ),&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; VAR StartTime = MAX(Timesheets[START_TIME Revised], TIME(7, 0, 0))&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; VAR EndTime = MIN(Timesheets[END_TIME Revised], TIME(8, 0, 0))&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; VAR MinutesWorked = &lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IF(&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; StartTime &amp;lt; EndTime,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DATEDIFF(StartTime, EndTime, MINUTE),&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; RETURN&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; MinutesWorked&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;EM&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/EM&gt;However, this gives a wild number as you can see:&lt;EM&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Essentially, the screenshot above just returns a 1 or 0 if someone worked in that hour, but i'd like to get the number of minutes worked in that hour. For example, if someone worked 09:30 to 13:00 it would show 30,60,60,60 accross the four columns.&lt;BR /&gt;&lt;BR /&gt;Thank you for any help in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 02 Jul 2024 09:17:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minutes-worked-per-hour/m-p/4020127#M158591</guid>
      <dc:creator>Wesley1979</dc:creator>
      <dc:date>2024-07-02T09:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Minutes worked per hour</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minutes-worked-per-hour/m-p/4021486#M158674</link>
      <description>&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>Wed, 03 Jul 2024 01:36:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minutes-worked-per-hour/m-p/4021486#M158674</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-07-03T01:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Minutes worked per hour</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minutes-worked-per-hour/m-p/4029652#M159277</link>
      <description>&lt;P&gt;Thank you for your reply. Unfortunately, the data used I am unable to get to upload.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;On a birghter note, I managed to resolve using:&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;04 = IF(&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;HOUR(Timesheets[START_TIME Revised]) = 4 &amp;amp;&amp;amp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;MINUTE(Timesheets[START_TIME Revised]) &amp;lt;&amp;gt; 0,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;60 - MINUTE(Timesheets[START_TIME Revised]) +&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;IF(&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;HOUR(Timesheets[END_TIME Revised]) = 4,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;MINUTE(Timesheets[END_TIME Revised]),&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;),&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;IF(&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;HOUR(Timesheets[START_TIME Revised]) &amp;lt;= 4 &amp;amp;&amp;amp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;HOUR(Timesheets[END_TIME Revised]) &amp;gt; 4,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;60,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;IF(&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;HOUR(Timesheets[END_TIME Revised]) = 4,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;MINUTE(Timesheets[END_TIME Revised]),&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;BLANK()&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Thanks for any views. Worm Regards&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 08:12:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minutes-worked-per-hour/m-p/4029652#M159277</guid>
      <dc:creator>Wesley1979</dc:creator>
      <dc:date>2024-07-08T08:12:37Z</dc:date>
    </item>
  </channel>
</rss>

