<?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: Difference between two dates with excluding weekends. in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Difference-between-two-dates-with-excluding-weekends/m-p/2845282#M39284</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/315050"&gt;@VenkataRavi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Assum that there is one date dimension table in your model, you can create a calculated column as below to get the number of days between two dates. Please find the details in &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;No.of Days =
VAR _enddate =
    IF ( ISBLANK ( 'Table'[End Date] ), TODAY (), 'Table'[End Date] )
RETURN
    CALCULATE (
        COUNTROWS ( 'Date' ),
        DATESBETWEEN ( 'Date'[Date], 'Table'[Start Date], _enddate ),
        FILTER ( 'Date', WEEKDAY ( 'Date'[Date], 2 ) &amp;lt; 6 )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yingyinr_0-1665970301166.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/805007i050D54CF9C86AF91/image-size/large?v=v2&amp;amp;px=999" role="button" title="yingyinr_0-1665970301166.png" alt="yingyinr_0-1665970301166.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In addition, you can refer the following blog to get it by &lt;STRONG&gt;DAX&lt;/STRONG&gt; or &lt;STRONG&gt;Power Query&lt;/STRONG&gt; method...&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blog.enterprisedna.co/calculate-workdays-between-two-dates-in-power-bi/" target="_self"&gt;Calculate Workdays Between Two Dates In Power BI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yingyinr_1-1665970540703.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/805008iB48593B668BEB17F/image-size/large?v=v2&amp;amp;px=999" role="button" title="yingyinr_1-1665970540703.png" alt="yingyinr_1-1665970540703.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Mon, 17 Oct 2022 01:35:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-10-17T01:35:54Z</dc:date>
    <item>
      <title>Difference between two dates with excluding weekends.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Difference-between-two-dates-with-excluding-weekends/m-p/2842376#M39262</link>
      <description>&lt;P&gt;Dear Team,&lt;/P&gt;&lt;P&gt;Please help me solve for construct below query.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;TD&gt;Start Date&lt;/TD&gt;&lt;TD&gt;End Date&lt;/TD&gt;&lt;TD&gt;No: of Days&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;201&lt;/TD&gt;&lt;TD&gt;Done&lt;/TD&gt;&lt;TD&gt;10/03/2022&lt;/TD&gt;&lt;TD&gt;10/06/2022&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;205&lt;/TD&gt;&lt;TD&gt;Approved&lt;/TD&gt;&lt;TD&gt;10/04/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;9(when end date is blank we need to consider Today()-Start Date.)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;206&lt;/TD&gt;&lt;TD&gt;Deployed&lt;/TD&gt;&lt;TD&gt;10/04/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;9(when end date is blank we need to consider Today()-Start Date.)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;207&lt;/TD&gt;&lt;TD&gt;Done&lt;/TD&gt;&lt;TD&gt;09/26/2022&lt;/TD&gt;&lt;TD&gt;09/29/2022&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please guide me how to write DAX fuction for above query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Advance Thanks,&lt;/P&gt;&lt;P&gt;Venkata.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 11:42:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Difference-between-two-dates-with-excluding-weekends/m-p/2842376#M39262</guid>
      <dc:creator>VenkataRavi</dc:creator>
      <dc:date>2022-10-14T11:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates with excluding weekends.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Difference-between-two-dates-with-excluding-weekends/m-p/2845063#M39276</link>
      <description>&lt;P&gt;Please read about the NETWORKDAYS() function.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 20:29:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Difference-between-two-dates-with-excluding-weekends/m-p/2845063#M39276</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-10-16T20:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates with excluding weekends.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Difference-between-two-dates-with-excluding-weekends/m-p/2845282#M39284</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/315050"&gt;@VenkataRavi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Assum that there is one date dimension table in your model, you can create a calculated column as below to get the number of days between two dates. Please find the details in &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;No.of Days =
VAR _enddate =
    IF ( ISBLANK ( 'Table'[End Date] ), TODAY (), 'Table'[End Date] )
RETURN
    CALCULATE (
        COUNTROWS ( 'Date' ),
        DATESBETWEEN ( 'Date'[Date], 'Table'[Start Date], _enddate ),
        FILTER ( 'Date', WEEKDAY ( 'Date'[Date], 2 ) &amp;lt; 6 )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yingyinr_0-1665970301166.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/805007i050D54CF9C86AF91/image-size/large?v=v2&amp;amp;px=999" role="button" title="yingyinr_0-1665970301166.png" alt="yingyinr_0-1665970301166.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In addition, you can refer the following blog to get it by &lt;STRONG&gt;DAX&lt;/STRONG&gt; or &lt;STRONG&gt;Power Query&lt;/STRONG&gt; method...&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blog.enterprisedna.co/calculate-workdays-between-two-dates-in-power-bi/" target="_self"&gt;Calculate Workdays Between Two Dates In Power BI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yingyinr_1-1665970540703.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/805008iB48593B668BEB17F/image-size/large?v=v2&amp;amp;px=999" role="button" title="yingyinr_1-1665970540703.png" alt="yingyinr_1-1665970540703.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 01:35:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Difference-between-two-dates-with-excluding-weekends/m-p/2845282#M39284</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-17T01:35:54Z</dc:date>
    </item>
  </channel>
</rss>

