<?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: Trying to develop a DAX query that will assess if an employee worked on their second day of leave. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-develop-a-DAX-query-that-will-assess-if-an-employee/m-p/3375676#M127106</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="532397" data-lia-user-login="tj7933" class="lia-mention lia-mention-user"&gt;tj7933&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please have a try.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;PreviousDayOffHours =
CALCULATE(
    SUM(TIMESHEETS_2023[DayOffHours]),
    DATEADD('Calendar'[Date], -1, DAY)
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;SecondLeaveDayHours =
IF(
    [IsLeaveDay] = 1 &amp;amp;&amp;amp; [PreviousDayIsLeaveDay] = 1,
    [TotalHoursWorked],
    BLANK()
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;BR /&gt;Community Support Team _ Rongtie&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Aug 2023 06:39:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-11T06:39:26Z</dc:date>
    <item>
      <title>Trying to develop a DAX query that will assess if an employee worked on their second day of leave.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-develop-a-DAX-query-that-will-assess-if-an-employee/m-p/3372941#M126965</link>
      <description>&lt;P&gt;Ok,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I must calculate the hours worked on an employee's second leave day.&lt;BR /&gt;&lt;BR /&gt;I cannot figure out how to work out whether or not the previous day was a day of leave.&amp;nbsp; I think I am missing something simple.&lt;BR /&gt;&lt;BR /&gt;Here is my logic and my attempts to solve this problem:&lt;/P&gt;&lt;P&gt;1)&lt;STRONG&gt;Did the employee work today?&lt;/STRONG&gt;&amp;nbsp; (I have covered this)&amp;nbsp; - Power Query - Total Hours Worked&lt;BR /&gt;2) &lt;STRONG&gt;Is today a day of leave?&lt;/STRONG&gt; (I have covered this) - Dax calculated Column =&amp;nbsp;=IF([Day Name]="Sunday" || [Day Name]="Saturday" || [STATS]="STAT",1,0)&lt;/P&gt;&lt;P&gt;3) &lt;STRONG&gt;Did the employee work the previous day?&lt;/STRONG&gt; (I have covered this) DAX Measure =CALCULATE(DISTINCTCOUNT(TIMESHEETS_2023[START - Date]), PREVIOUSDAY('Calendar'[Date]))&lt;/P&gt;&lt;P&gt;4) &lt;STRONG&gt;Is the previous day a day of leave (Saturday, Sunday or STAT)?&amp;nbsp;&lt;/STRONG&gt; (not sure how to address this) this is my attempt DAX Measure =CALCULATE(SUM(TIMESHEETS_2023[DayOffHours]),DATEADD('Calendar'[Date],-1,DAY)) (DAY OFF HOURS =&amp;nbsp;Calculated Column =&amp;nbsp;IF([DayOff]&amp;gt;0,[TotalHoursWorked],0)&lt;BR /&gt;5) &lt;STRONG&gt;if all items 1 to 5 are yes,&lt;/STRONG&gt; sum the total hours worked today.&amp;nbsp;(not sure how to address this)&lt;BR /&gt;&lt;BR /&gt;If you think you can do this more simply (I am overthinking things) and/or you have ideas to address this calculation, I am very open to learning more and hearing suggestions.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;Tammy&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 20:36:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-develop-a-DAX-query-that-will-assess-if-an-employee/m-p/3372941#M126965</guid>
      <dc:creator>tj7933</dc:creator>
      <dc:date>2023-08-09T20:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to develop a DAX query that will assess if an employee worked on their second day of leave.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-develop-a-DAX-query-that-will-assess-if-an-employee/m-p/3375676#M127106</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="532397" data-lia-user-login="tj7933" class="lia-mention lia-mention-user"&gt;tj7933&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please have a try.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;PreviousDayOffHours =
CALCULATE(
    SUM(TIMESHEETS_2023[DayOffHours]),
    DATEADD('Calendar'[Date], -1, DAY)
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;SecondLeaveDayHours =
IF(
    [IsLeaveDay] = 1 &amp;amp;&amp;amp; [PreviousDayIsLeaveDay] = 1,
    [TotalHoursWorked],
    BLANK()
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;BR /&gt;Community Support Team _ Rongtie&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 06:39:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-develop-a-DAX-query-that-will-assess-if-an-employee/m-p/3375676#M127106</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-11T06:39:26Z</dc:date>
    </item>
  </channel>
</rss>

