<?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: Calculated Column To Determine Attendance Status in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4640728#M177675</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1243991" target="_blank"&gt;@imbetto&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, Please let us know if your issue is solved. If it is, consider marking the answer that helped&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Accept as Solution'&lt;/STRONG&gt;&lt;SPAN&gt;, so others with similar queries can find it easily. If not, please share the details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Apr 2025 09:54:42 GMT</pubDate>
    <dc:creator>v-hashadapu</dc:creator>
    <dc:date>2025-04-07T09:54:42Z</dc:date>
    <item>
      <title>Calculated Column To Determine Attendance Status</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4621161#M176870</link>
      <description>&lt;P&gt;I am building an attendance dashboard and already integrated holidays and weekends and a calculated column that calculated the durantion between the earliest entry and latest exit timestamps and everything checks out except for the "Attendance Status" calculated column where I am using the SWITCH function with all possible conditions but I am not getting the expected results as can be seen in the screenshot, when the day is "Regular" and the completed hours are equal or more than 8 then it should be fulfilled otherwise it is incomplete same with ramadan but the hours being 5 instead but I "Absent" and "Not Required" are the only results I am getting even when that is not the case. I tried to test out each condition individualy to troubleshoot but to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the dax expression I used:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Attendance Status =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ISBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Completed_Hours]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;RELATED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Calendar&lt;/SPAN&gt;&lt;SPAN&gt;[DayType]&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN&gt;"Weekend"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Holiday"&lt;/SPAN&gt;&lt;SPAN&gt;}, &lt;/SPAN&gt;&lt;SPAN&gt;"Not Required"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ISBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Completed_Hours]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp;&amp;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&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;RELATED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Calendar&lt;/SPAN&gt;&lt;SPAN&gt;[DayType]&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN&gt;"Weekend"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Holiday"&lt;/SPAN&gt;&lt;SPAN&gt;} &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;[Completed_Hours]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;8&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Incomplete"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Unknown"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 23 Mar 2025 09:10:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4621161#M176870</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-03-23T09:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column To Determine Attendance Status</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4621236#M176875</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;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &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;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>Sun, 23 Mar 2025 12:53:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4621236#M176875</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-03-23T12:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column To Determine Attendance Status</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4621384#M176885</link>
      <description>&lt;P&gt;Hi &amp;nbsp;Anonymous&lt;/LI-USER&gt;&lt;/P&gt;
&lt;P data-start="231" data-end="490"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="231" data-end="490"&gt;What I can see, the issue might be that your &lt;EM&gt;SWITCH(TRUE()) &lt;/EM&gt;logic is evaluating the hours before checking the special day types like Holiday, Weekend, etc. So even if it should be marked as “Holiday” or “Leave,” it’s defaulting to “Absent” too early.&lt;/P&gt;
&lt;P data-start="492" data-end="669"&gt;One approach that’s worked for me in the past is to check all the special conditions first (like holidays, weekends, approved leave, etc.), and only then check the hours worked.&lt;/P&gt;
&lt;P data-start="671" data-end="712"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="671" data-end="712"&gt;Here’s a cleaner structure you could try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Attendance Status =
VAR Hrs = COALESCE('Attendance'[Completed Hours], 0)
VAR IsHoliday = RELATED('Calendar'[HolidayFlag]) = 1
VAR IsWeekend = RELATED('Calendar'[WeekendFlag]) = 1
VAR NotReq = RELATED('Calendar'[NotRequiredFlag]) = 1
VAR IsLeave = RELATED('Leave'[ApprovedLeaveFlag]) = 1
VAR IsSick = RELATED('Sickness'[SickFlag]) = 1

RETURN
SWITCH (
    TRUE(),
    NotReq, "Not Required",
    IsHoliday, "Holiday",
    IsWeekend, "Weekend",
    IsLeave, "Leave",
    IsSick, "Sick",
    ISBLANK('Attendance'[Completed Hours]), "No Time",
    Hrs &amp;gt;= 7.5, "Present",
    Hrs &amp;gt;= 4, "Half Day",
    Hrs &amp;gt; 0, "Partial",
    "Absent"
)&lt;/LI-CODE&gt;
&lt;DIV class=""&gt;
&lt;DIV class="" dir="ltr"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P data-start="1358" data-end="1496"&gt;This structure checks all special cases first and only then evaluates based on hours. It also handles blanks more safely using &lt;EM&gt;COALESCE.&lt;/EM&gt;&lt;/P&gt;
&lt;P data-start="1498" data-end="1630"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="1498" data-end="1630"&gt;One thing to double-check make sure the relationships to your Calendar and other lookup tables are active and working as expected&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 13:35:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4621384#M176885</guid>
      <dc:creator>rohit1991</dc:creator>
      <dc:date>2025-07-28T13:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column To Determine Attendance Status</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4630249#M177252</link>
      <description>&lt;P&gt;&lt;SPAN data-teams="true"&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, Please let us know if your issue is solved. If it is, consider marking the answer that helped&amp;nbsp;&lt;STRONG&gt;'Accept as Solution'&lt;/STRONG&gt;, so others with similar queries can find it easily. If not, please share the details.&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Mar 2025 10:08:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4630249#M177252</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-03-29T10:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column To Determine Attendance Status</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4640728#M177675</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1243991" target="_blank"&gt;@imbetto&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, Please let us know if your issue is solved. If it is, consider marking the answer that helped&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Accept as Solution'&lt;/STRONG&gt;&lt;SPAN&gt;, so others with similar queries can find it easily. If not, please share the details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 09:54:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4640728#M177675</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-04-07T09:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column To Determine Attendance Status</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4646757#M177864</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1243991" target="_blank" rel="noopener"&gt;@imbetto&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, Please let us know if your issue is solved. If it is, consider marking the answer that helped&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Accept as Solution'&lt;/STRONG&gt;&lt;SPAN&gt;, so others with similar queries can find it easily. If not, please share the details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 11:33:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-To-Determine-Attendance-Status/m-p/4646757#M177864</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-04-10T11:33:44Z</dc:date>
    </item>
  </channel>
</rss>

