<?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: Count how many workdays that are from Min and Max value of the slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2174487#M50560</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="277465" data-lia-user-login="v-cazheng-msft" class="lia-mention lia-mention-user"&gt;v-cazheng-msft&lt;/a&gt;&amp;nbsp;First off, thank you so much for going through the trouble of creating a testfile with the right dimensions, really appreciate it!&lt;BR /&gt;&lt;BR /&gt;I applied those and still noticed some bugs so downloaded your file and realized that the formula is not picking up the right values.&amp;nbsp; See screenshot below, where I chose 7 total days (but only 5 business days) and we are getting incorrect values all around. Any ideas on how to fix the discrepancy?&lt;BR /&gt;&lt;BR /&gt;Thank you!!&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Nov 2021 10:22:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-11-05T10:22:44Z</dc:date>
    <item>
      <title>Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166185#M50193</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been struggling with this one for a few days and wonder if someone can help.&lt;/P&gt;&lt;P&gt;I have a slicer with a date dimension "created_date", and I'm looking to get the count of how many working days are between the min and max value of the "created_date".&lt;BR /&gt;&lt;BR /&gt;I've done two things:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Created a column with:&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;WorkWeekDays = IF(WEEKDAY(CASES[Weekdays])&amp;gt;=6,FALSE,TRUE)&lt;BR /&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN&gt;This works well: one the "weekdays" I have:&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;Weekdays = WEEKDAY(CASES[created_date],2)&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;SPAN&gt;Created a C&lt;SPAN&gt;CountWorkDays"&amp;nbsp;&lt;/SPAN&gt;measure with The calculation below:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;CountWorkDays = &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;VAR FirstDay = CALCULATE(MIN('CASES'[created_date]), ALLSELECTED('CASES'[created_date]))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;VAR LASTDAY = CALCULATE(MAX('CASES'[created_date]), ALLSELECTED('CASES'[created_date]))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;var Weekdays = COUNTROWS(FILTER(CASES, CASES[WorkWeekDays] = FALSE()))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;DATEDIFF(FirstDay,LASTDAY,DAY)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;---&lt;BR /&gt;&lt;BR /&gt;I realise I am not comparing it to the "Weekdays" var but haven't found a good way to do so.&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 01 Nov 2021 12:12:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166185#M50193</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-01T12:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166260#M50198</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Here is Net Work Days in DAX:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Days/m-p/367362#M109" target="_blank"&gt;Net Work Days - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 12:58:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166260#M50198</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-11-01T12:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166394#M50209</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;you seem to have 2 different date dimensions in your example, does that changes things? I've tried it and couldn't make it work.&lt;BR /&gt;&lt;BR /&gt;It seems that the RETURN function is what I'm doing wrong though, could I utilize something like this based on my previous example/variables?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTX(FILTER( DATEDIFF(FirstDay,LASTDAY,DAY),Weekends=&amp;lt;6)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 01 Nov 2021 14:01:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166394#M50209</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-01T14:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166441#M50211</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Shouldn't matter. Why do you have DATEDIFF in there? You can't use DATEDIFF&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 14:17:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166441#M50211</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-11-01T14:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166505#M50215</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;I've used your example but getting a return of thousands of days which is not right, should be 2 days instead.&lt;BR /&gt;&lt;BR /&gt;Can you check what is wrong here?&lt;BR /&gt;&lt;BR /&gt;NetWorkDays = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Calendar1 = CALENDAR(MAX(CASES[created_time]),MAX(CASES[created_time]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Calendar2 = ADDCOLUMNS(CASES,"WeekDay_new",WEEKDAY(CASES[created_time],2))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN COUNTX(FILTER(Calendar2,[WeekDay_new]&amp;lt;6),CASES[created_time])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 01 Nov 2021 14:46:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166505#M50215</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-01T14:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166559#M50223</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Sorry, but that's not even close. The original formula is:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;NetWorkDays = 
VAR Calendar1 = CALENDAR(MAX(NetWorkDays[created date]),MAX(NetWorkDays[review date]))
VAR Calendar2 = ADDCOLUMNS(Calendar1,"WeekDay",WEEKDAY([Date],2))
RETURN COUNTX(FILTER(Calendar2,[WeekDay]&amp;lt;6),[Date])&lt;/LI-CODE&gt;
&lt;P&gt;So, making a ton of assumptions, seems like the translation to your data would be something like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;NetWorkDays = 
// The calendar needs to start at your minimum date and end at your maximum date in context
  VAR __Calendar1 = CALENDAR(MIN(CASES[created_time]),MAX(CASES[created_time]))
  VAR __Calendar2 = ADDCOLUMNS(__Calendar1,"__WeekDay",WEEKDAY([Date],2))
RETURN
// this is an improvement on the original to use COUNTROWS instead of COUNTX
COUNTROWS(FILTER(Calendar2,[__WeekDay]&amp;lt;6))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 01 Nov 2021 15:31:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166559#M50223</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-11-01T15:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166591#M50228</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;I used your example and modified a few things but still getting over 30k results while it should be 3. Any ideas why? Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NetWorkDays = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// The calendar needs to start at your minimum date and end at your maximum date in context&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR __Calendar1 = CALENDAR(MIN(CASES[created_time]),MAX(CASES[created_time]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR __Calendar2 = ADDCOLUMNS(__Calendar1,"__WeekDay",WEEKDAY(CASES[created_time],2))&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;// this is an improvement on the original to use COUNTROWS instead of COUNTX&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS(FILTER(__Calendar2,[__WeekDay]&amp;lt;6))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 01 Nov 2021 16:00:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2166591#M50228</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-01T16:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2167164#M50257</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;I do not without sample data. The entire formula is predicated on what MIN date and MAX date you start with. You could change these into variables and return them in the RETURN statement to see what they are in context of whatever visual you are using. You have to pair the measure with something that is going to limit the context to what you are trying to figure out, like a case number or something. I am mildly concerned that you only have only a single column, you would generally have a "start" and "stop" time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me go a big deeper into context, suppose you have the following table:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;index&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;category&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;create_time&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;red&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;11/1/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;red&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;11/2/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;3&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;red&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;11/3/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;4&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;blue&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;11/4/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;5&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;blue&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;11/5/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;6&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;blue&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;11/6/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;7&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;green&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;11/7/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;8&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;green&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;11/8/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;9&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;green&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;11/9/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;10&lt;/TD&gt;
&lt;TD&gt;green&lt;/TD&gt;
&lt;TD&gt;11/10/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given that table, if you just use the measure as is, you would get 8 because the entire table is in context and there is a single weekend. If you used Index along with the measure, then every row would return 1 because the min and max dates would be the same except for 6 and 7 which would be 0. If you used category, red would return 3, blue 2 and green 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, without any idea what your data looks like or how you are using the measure, I cannot possibly hope to answer your question about why you are getting 30,000 other than you aren't doing something correctly.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 23:25:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2167164#M50257</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-11-01T23:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2173971#M50542</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this &lt;STRONG&gt;Measure&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;CountWorkDays =&lt;/P&gt;
&lt;P&gt;VAR FirstDay =&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATE (&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MIN ( 'CASES'[created_date] ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALLSELECTED ( 'CASES'[created_date] )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;VAR LASTDAY =&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATE (&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAX ( 'CASES'[created_date] ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALLSELECTED ( 'CASES'[created_date] )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;VAR Weekdays =&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATE (&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT ( 'CASES'[created_date] ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILTER (&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'CASES',&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'CASES'[created_date] &amp;gt;= FirstDay&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp; 'CASES'[created_date] &amp;lt;= LASTDAY&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp; 'CASES'[WorkWeekDays] = TRUE ()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;RETURN&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Weekdays&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result looks like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, attached the pbix file as a reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _ Caiyun&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly. If you still have problems on it, please feel free to let us know. Thanks a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 05:33:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2173971#M50542</guid>
      <dc:creator>v-cazheng-msft</dc:creator>
      <dc:date>2021-11-05T05:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2174487#M50560</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="277465" data-lia-user-login="v-cazheng-msft" class="lia-mention lia-mention-user"&gt;v-cazheng-msft&lt;/a&gt;&amp;nbsp;First off, thank you so much for going through the trouble of creating a testfile with the right dimensions, really appreciate it!&lt;BR /&gt;&lt;BR /&gt;I applied those and still noticed some bugs so downloaded your file and realized that the formula is not picking up the right values.&amp;nbsp; See screenshot below, where I chose 7 total days (but only 5 business days) and we are getting incorrect values all around. Any ideas on how to fix the discrepancy?&lt;BR /&gt;&lt;BR /&gt;Thank you!!&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 10:22:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2174487#M50560</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-05T10:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2175837#M50607</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="277465" data-lia-user-login="v-cazheng-msft" class="lia-mention lia-mention-user"&gt;v-cazheng-msft&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;Any ideas on how to fix the gap on that testfile? Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 06 Nov 2021 13:08:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2175837#M50607</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-06T13:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2176861#M50636</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It’s related to the values in your created_date column.&amp;nbsp;If you set the Slicer type as &lt;STRONG&gt;Between&lt;/STRONG&gt; but not&lt;STRONG&gt; List,&lt;/STRONG&gt; the values displayed in slicer are some consecutive dates by design. Based on the info from you, I guess this date column should contain some non-consecutive dates. And the count is based on this column, so the result will be the number of dates contained in this column and between the selected date range.&amp;nbsp;If you would like to count the work days according to the date range in the slicer, please try this &lt;STRONG&gt;Measure&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CountWorkDays =&lt;/P&gt;
&lt;P&gt;VAR FirstDay =&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATE (&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MIN ( 'CASES'[created_date] ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALLSELECTED ( 'CASES'[created_date] )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;VAR LASTDAY =&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATE (&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAX ( 'CASES'[created_date] ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALLSELECTED ( 'CASES'[created_date] )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;VAR calendar_ =&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALENDAR ( FirstDay, LASTDAY )&lt;/P&gt;
&lt;P&gt;VAR work_cal =&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADDCOLUMNS ( calendar_, "work", WEEKDAY ( [Date], 2 ) )&lt;/P&gt;
&lt;P&gt;RETURN&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNTAX ( FILTER ( work_cal, [work] &amp;lt; 6 ), [Date] )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The the result will look like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, attached the pbix file as reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _ Caiyun&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly. If you still have problems on it, please feel free to let us know. Thanks a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 02:06:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2176861#M50636</guid>
      <dc:creator>v-cazheng-msft</dc:creator>
      <dc:date>2021-11-08T02:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count how many workdays that are from Min and Max value of the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2184624#M50913</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I know whether the newly posted solution helps you get the result you want? If it helps, could you please kindly&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly. If you still have problems on it, please feel free to let us know. Thanks in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _ Caiyun&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 07:30:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-how-many-workdays-that-are-from-Min-and-Max-value-of-the/m-p/2184624#M50913</guid>
      <dc:creator>v-cazheng-msft</dc:creator>
      <dc:date>2021-11-11T07:30:20Z</dc:date>
    </item>
  </channel>
</rss>

