<?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 Total Working Days in a month based on slicer selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Working-Days-in-a-month-based-on-slicer-selection/m-p/1606508#M32233</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a link to my pbix sample file (here -&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://tinyurl.com/y522q5l7" target="_blank"&gt;https://tinyurl.com/y522q5l7&lt;/A&gt;&amp;nbsp;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to select a date range and retrieve the number of working days in each of those represented months.&amp;nbsp; So, if the date slicer were 8/1/20-8/15/20 that is the month of August.&amp;nbsp; The month of August has 21 working days in it (for my specific calendar anyway).&amp;nbsp; &amp;nbsp;Therefore, I need the result of "21".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the date slicer is 8/1/20-9/15/20 that is August and September.&amp;nbsp; August has 21 working days and September has 21 working days in my calendar file so I need to have a result of "42".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my DateDim I have whether or not the date is a working day.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble getting the DAX right to give me that total working number of all the months and would be most appreciative if somebody could help me out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jan 2021 18:28:06 GMT</pubDate>
    <dc:creator>collinq</dc:creator>
    <dc:date>2021-01-18T18:28:06Z</dc:date>
    <item>
      <title>Total Working Days in a month based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Working-Days-in-a-month-based-on-slicer-selection/m-p/1606508#M32233</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a link to my pbix sample file (here -&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://tinyurl.com/y522q5l7" target="_blank"&gt;https://tinyurl.com/y522q5l7&lt;/A&gt;&amp;nbsp;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to select a date range and retrieve the number of working days in each of those represented months.&amp;nbsp; So, if the date slicer were 8/1/20-8/15/20 that is the month of August.&amp;nbsp; The month of August has 21 working days in it (for my specific calendar anyway).&amp;nbsp; &amp;nbsp;Therefore, I need the result of "21".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the date slicer is 8/1/20-9/15/20 that is August and September.&amp;nbsp; August has 21 working days and September has 21 working days in my calendar file so I need to have a result of "42".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my DateDim I have whether or not the date is a working day.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble getting the DAX right to give me that total working number of all the months and would be most appreciative if somebody could help me out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 18:28:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Working-Days-in-a-month-based-on-slicer-selection/m-p/1606508#M32233</guid>
      <dc:creator>collinq</dc:creator>
      <dc:date>2021-01-18T18:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Total Working Days in a month based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Working-Days-in-a-month-based-on-slicer-selection/m-p/1606740#M32240</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="7492" data-lia-user-login="collinq" class="lia-mention lia-mention-user"&gt;collinq&lt;/a&gt; -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This might not be that elegant, but give it a try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;NumWorkDays =
VAR __MinDt =
    CALCULATE ( MIN ( DateTab[Date] ), ALLSELECTED ( DateTab[Date] ) )
VAR __MaxDt =
    CALCULATE ( MAX ( DateTab[Date] ), ALLSELECTED ( DateTab[Date] ) )
VAR __MinMth =
    MONTH ( __MinDt )
VAR __MinYr =
    YEAR ( __MinDt )
VAR __MaxMth =
    MONTH ( __MaxDt )
VAR __MaxYr =
    YEAR ( __MaxDt )
VAR __MinDate =
    DATE ( __MinYr, __MinMth, 1 )
VAR __MaxDate =
    EOMONTH ( DATE ( __MaxYr, __MaxMth, 1 ), 0 )
RETURN
    CALCULATE (
        COUNTROWS (
            FILTER (
                ALL ( DateTab ),
                DateTab[Date] &amp;gt;= __MinDate
                    &amp;amp;&amp;amp; DateTab[Date] &amp;lt;= __MaxDate
                    &amp;amp;&amp;amp; DateTab[IsWorkDay]
            )
        )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(IsWorkDay is a Boolean on the Date table marking Sat-Sun as false, so ignoring holidays)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should be able to span years, not just months.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 20:30:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Working-Days-in-a-month-based-on-slicer-selection/m-p/1606740#M32240</guid>
      <dc:creator>dedelman_clng</dc:creator>
      <dc:date>2021-01-18T20:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Total Working Days in a month based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Working-Days-in-a-month-based-on-slicer-selection/m-p/1608879#M32309</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13353" data-lia-user-login="dedelman_clng" class="lia-mention lia-mention-user"&gt;dedelman_clng&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Elegant or not, that is beautiful to me!&amp;nbsp; Thanks so much!!!&amp;nbsp; I was definitely going down a much different and eventually ineffective solution.&amp;nbsp; Thanks for your time and thanks for your effort!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 15:01:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Working-Days-in-a-month-based-on-slicer-selection/m-p/1608879#M32309</guid>
      <dc:creator>collinq</dc:creator>
      <dc:date>2021-01-19T15:01:53Z</dc:date>
    </item>
  </channel>
</rss>

