<?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: Expected hours per day in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expected-hours-per-day/m-p/3969632#M153963</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>Mon, 03 Jun 2024 21:17:12 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-06-03T21:17:12Z</dc:date>
    <item>
      <title>Expected hours per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expected-hours-per-day/m-p/3968436#M153899</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently looking to write a DAX measure that looks at the expected hours per day vs recorded hours.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Data structure&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Date&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Date table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Resource&lt;/U&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Role&lt;/TD&gt;&lt;TD&gt;Start Date&lt;/TD&gt;&lt;TD&gt;End Date&lt;/TD&gt;&lt;TD&gt;FTE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Time Record&lt;/U&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Activity&lt;/TD&gt;&lt;TD&gt;Hours&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Names&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Bridging table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Relationships&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Date table is linked to Resource on start date and end date with inactive relationships&lt;/P&gt;&lt;P&gt;Date table linked to Time Record on date with active relationship&lt;/P&gt;&lt;P&gt;Time Record linked to Names with active relationship&lt;/P&gt;&lt;P&gt;Resource linked to Names with active relationship&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Expected Outcome&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1/5/24&lt;/TD&gt;&lt;TD&gt;1/5/24&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1/5/24&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;2/5/24&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2/5/24&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;2/5/24&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;....&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Expected&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Difference&lt;/TD&gt;&lt;TD&gt;Expected&lt;/TD&gt;&lt;TD&gt;Actual&lt;/TD&gt;&lt;TD&gt;Difference&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected hours is 8 hours * FTE but only applies to week days which I wasn't sure how to approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the measure I've written so far for Expected Hours but it isn't quite working and isn't accounting for week days. Not quite sure where to start with the difference yet either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Expected Hours =&lt;BR /&gt;SUMX(&lt;BR /&gt;  VALUES('Resource'[Name]),&lt;BR /&gt;  CALCULATE(&lt;BR /&gt;    SUMX('Resource',&lt;BR /&gt;      IF('Resource'[Start Date]&amp;lt;=TODAY() &amp;amp;&amp;amp; ISBLANK('Resource'[End Date] &amp;amp;&amp;amp; 'Resource'[Start Date]&amp;lt;MAX('Date'[Date]),&lt;BR /&gt;        'Resource'[FTE]*8,&lt;BR /&gt;      IF(IF('Resource'[Start Date]&amp;lt;=TODAY() &amp;amp;&amp;amp; 'Resource'[End Date]&amp;gt;TODAY() &amp;amp;&amp;amp; 'Resource'[Start Date]&amp;lt;MAX('Date'[Date]),&lt;BR /&gt;        'Resource'[FTE]*8,&lt;BR /&gt;        0)&lt;BR /&gt;      )&lt;BR /&gt;    )&lt;BR /&gt;  )&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;Any help would be very much appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 10:45:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expected-hours-per-day/m-p/3968436#M153899</guid>
      <dc:creator>metcala</dc:creator>
      <dc:date>2024-06-03T10:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Expected hours per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expected-hours-per-day/m-p/3969632#M153963</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>Mon, 03 Jun 2024 21:17:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expected-hours-per-day/m-p/3969632#M153963</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-06-03T21:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Expected hours per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expected-hours-per-day/m-p/3970543#M153994</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;, thanks for your concern about this case, I have an addition to make to the content.&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="465614" data-lia-user-login="metcala" class="lia-mention lia-mention-user"&gt;metcala&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If by weekdays you mean Monday to Friday, you can add the following filter to the formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;NOT(WEEKDAY(MAX('Table'[Date]),2)) in {6,7}&lt;/LI-CODE&gt;
&lt;P&gt;If by weekdays you mean not only Monday to Friday but also the rest of the holidays, you can first use Enter data to create a table to collect the holiday information and add the following filter to the formula:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;NOT(WEEKDAY(MAX('Table'[Date]),2)) in {6,7} &amp;amp;&amp;amp; NOT(MAX('Table'[Date])) in SELECTCOLUMNS('Holidays_Table',"date",[Holidays])&lt;/LI-CODE&gt;
&lt;P&gt;If it doesn't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 07:35:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Expected-hours-per-day/m-p/3970543#M153994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-04T07:35:42Z</dc:date>
    </item>
  </channel>
</rss>

