<?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 Work around for membership days in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Work-around-for-membership-days/m-p/1306806#M22717</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have been trying to create membership days for employees based on their start date and end date and our holiday table. My current calculated column looks like this,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Var TBL_Date = Calendar('tEmployee'[Enter_Date],'tEmployee'[Leave_Date])

Var TBL_Finaldt = 
ADDCOLUMNS(TBL_Date, 
"Work Days", If(WEEKDAY([Date],2)&amp;gt;5,0,1)
"Off Days", IFERROR(LOOKUPVALUE('tCompanyCalendar'[Day_Count],'tCompanyCalendar'[Date],[Date],0))

Return
If(SUMX(TBL_Finaldt, IF[Work Days] = 1 &amp;amp;&amp;amp; [Off Days] =1,1,0))=0,1,(SUMX(TBL_Finaldt,IF([Work Days] = 1 &amp;amp;&amp;amp; [Off Days] =1,1,0))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I currently have employees who will be starting in the future and this formula is not working for them and causing error overall. Is there a way I can block that?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Aug 2020 09:11:17 GMT</pubDate>
    <dc:creator>supergallager34</dc:creator>
    <dc:date>2020-08-19T09:11:17Z</dc:date>
    <item>
      <title>Work around for membership days</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Work-around-for-membership-days/m-p/1306806#M22717</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have been trying to create membership days for employees based on their start date and end date and our holiday table. My current calculated column looks like this,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Var TBL_Date = Calendar('tEmployee'[Enter_Date],'tEmployee'[Leave_Date])

Var TBL_Finaldt = 
ADDCOLUMNS(TBL_Date, 
"Work Days", If(WEEKDAY([Date],2)&amp;gt;5,0,1)
"Off Days", IFERROR(LOOKUPVALUE('tCompanyCalendar'[Day_Count],'tCompanyCalendar'[Date],[Date],0))

Return
If(SUMX(TBL_Finaldt, IF[Work Days] = 1 &amp;amp;&amp;amp; [Off Days] =1,1,0))=0,1,(SUMX(TBL_Finaldt,IF([Work Days] = 1 &amp;amp;&amp;amp; [Off Days] =1,1,0))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I currently have employees who will be starting in the future and this formula is not working for them and causing error overall. Is there a way I can block that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 09:11:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Work-around-for-membership-days/m-p/1306806#M22717</guid>
      <dc:creator>supergallager34</dc:creator>
      <dc:date>2020-08-19T09:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Work around for membership days</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Work-around-for-membership-days/m-p/1306845#M22718</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="251150" data-lia-user-login="supergallager34" class="lia-mention lia-mention-user"&gt;supergallager34&lt;/a&gt; , refer if this blog can help&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or this file, check the second page - Datediff with and without week end&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0" target="_blank"&gt;https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/s/bqbei7b8qbq5xez/leavebetweendates.pbix?dl=0" target="_blank"&gt;https://www.dropbox.com/s/bqbei7b8qbq5xez/leavebetweendates.pbix?dl=0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 09:24:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Work-around-for-membership-days/m-p/1306845#M22718</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-19T09:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Work around for membership days</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Work-around-for-membership-days/m-p/1307789#M22746</link>
      <description>Hi there.&lt;BR /&gt;&lt;BR /&gt;This code is not only ugly, it'll be very slow. Whether you're going to experience a slowdown or not depends on how much data is kept in the model. But code that uses: iferror, lookupvalue, a virtual table created on the fly, addcolumns, many if's... will be agonizingly slow since all operations will be handled by Formula Engine. For instance, iferror is known to be slow and should be avoided as much as possible.&lt;BR /&gt;&lt;BR /&gt;Why don't you move holidays to your Calendar table? Just mark a day with TRUE if it's a holiday and FALSE if not. This simple change will make the code much easier on the eye and faster. You won't have to even create the TBL_Date table on the fly...</description>
      <pubDate>Wed, 19 Aug 2020 14:23:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Work-around-for-membership-days/m-p/1307789#M22746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-19T14:23:17Z</dc:date>
    </item>
  </channel>
</rss>

