<?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: EOMONTH working days calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467659#M27810</link>
    <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Looking into this I think the :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _Month = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;EOMONTH (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATE ( LEFT ( MAX ( 'DimDate'[Month Year] ), 4 ), VALUE ( RIGHT ( MAX ( 'DimDate'[Month Year] ), 2 ) ), 1 ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;assumes that there are 30/31 days in each month?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sun, 01 Nov 2020 10:43:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-01T10:43:58Z</dc:date>
    <item>
      <title>EOMONTH working days calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467574#M27797</link>
      <description>&lt;P&gt;I have a measure to subtract the total number of days in a month e.g. 31 - absence.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _lastday =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DAY (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;EOMONTH (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATE ( LEFT ( MAX ( 'DimDate'[Month Year] ), 4 ), VALUE ( RIGHT ( MAX ( 'DimDate'[Month Year] ), 2 ) ), 1 ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF ( ISBLANK ( [AbsentByDay] ), BLANK (), _lastday ) - [AbsentByDay]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is there a way to only include working days in this calculation e.g. 22 working days in month - absence?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;e.g.&amp;nbsp;NOT WEEKDAY( 'DimDate'[Date] ) IN { 1,7 }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;File attached:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://www.dropbox.com/s/3oa7bx1rki1sl5j/Sample1%28updated%29.pbix?dl=0" target="_blank"&gt;https://www.dropbox.com/s/3oa7bx1rki1sl5j/Sample1%28updated%29.pbix?dl=0&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 01 Nov 2020 07:51:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467574#M27797</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-01T07:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: EOMONTH working days calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467607#M27801</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have modified the formula to include only workdays, I consider weekday 1 and 7 as weekend, you can change if you need.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 

VAR _Month = 
    EOMONTH (
        DATE ( LEFT ( MAX ( 'DimDate'[Month Year] ), 4 ), VALUE ( RIGHT ( MAX ( 'DimDate'[Month Year] ), 2 ) ), 1 ),
        0
    )

VAR _lastday= 
COUNTROWS(
    FILTER(
        CALENDAR( EDATE(_Month , -1)+1 , _Month ),
        NOT( WEEKDAY( [Date] ) IN { 1,7 })
    )
)

RETURN
 IF ( ISBLANK ( [AbsentByDay] ), BLANK (), _lastday ) - [AbsentByDay]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help the other members find it&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 08:44:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467607#M27801</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-11-01T08:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: EOMONTH working days calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467639#M27807</link>
      <description>&lt;P&gt;This works great but I'm having trouble with 1 or 2 values not adding up&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I think person_id 135 was absent twice in month : 201902, is there any way to account for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/jrvtgfms7akm1fv/Sample2%28updated%29.pbix?dl=0" target="_blank"&gt;https://www.dropbox.com/s/jrvtgfms7akm1fv/Sample2%28updated%29.pbix?dl=0&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 09:47:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467639#M27807</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-01T09:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: EOMONTH working days calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467653#M27809</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The DimDate table has a column, Working Day, I used that as that is your basis for other measures:&lt;BR /&gt;&lt;BR /&gt;Please check now:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure 3 = 

VAR _Month = 
    EOMONTH (
        DATE ( LEFT ( MAX ( 'DimDate'[Month Year] ), 4 ), VALUE ( RIGHT ( MAX ( 'DimDate'[Month Year] ), 2 ) ), 1 ),
        0
    )
VAR _lastday= 
COUNTROWS(
    FILTER(
        DimDate,
        DimDate[Date] &amp;gt;= EDATE(_Month , -1)+1 &amp;amp;&amp;amp; DimDate[Date] &amp;lt;= _Month &amp;amp;&amp;amp; DimDate[WorkingDays] = TRUE())
)    

RETURN

 IF ( ISBLANK ( [AbsentByDay] ), BLANK (), _lastday ) - [AbsentByDay]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help the other members find it&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank" rel="noopener"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank" rel="noopener"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 10:28:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467653#M27809</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-11-01T10:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: EOMONTH working days calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467659#M27810</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Looking into this I think the :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _Month = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;EOMONTH (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATE ( LEFT ( MAX ( 'DimDate'[Month Year] ), 4 ), VALUE ( RIGHT ( MAX ( 'DimDate'[Month Year] ), 2 ) ), 1 ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;assumes that there are 30/31 days in each month?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 01 Nov 2020 10:43:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOMONTH-working-days-calculation/m-p/1467659#M27810</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-01T10:43:58Z</dc:date>
    </item>
  </channel>
</rss>

