<?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 Difference date calculation considering holidays per counties in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3793908#M148262</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I need to calculate networkingdays between 2 dates considerinh weekend and country holidays.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In excell I succeded by creating a table with holidays per country (pic attached) and by applying the following formula:&lt;/P&gt;&lt;P&gt;IF(D3&amp;gt;0;NETWORKDAYS.INTL(C3;D3;1;FILTER(Holiday;Holiday[#Headers]='base dati'!G3))-1;"n/a")&lt;/P&gt;&lt;P&gt;D3 is the date of delivery C3 is the date of the entrust of the delivery.&lt;/P&gt;&lt;P&gt;Holiday is the table below&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to do the same in Power Bi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this formula to calculate the difference, but I dont'know how to apply the excel FILTER formula&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Data consegna]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Data consegna]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NETWORKDAYS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Data Spedizione]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Data consegna]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a sheet with the database&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have a sheet with the holidays per each European country calledPubHol&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Mar 2024 11:17:02 GMT</pubDate>
    <dc:creator>elycape90</dc:creator>
    <dc:date>2024-03-27T11:17:02Z</dc:date>
    <item>
      <title>Difference date calculation considering holidays per counties</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3793908#M148262</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I need to calculate networkingdays between 2 dates considerinh weekend and country holidays.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In excell I succeded by creating a table with holidays per country (pic attached) and by applying the following formula:&lt;/P&gt;&lt;P&gt;IF(D3&amp;gt;0;NETWORKDAYS.INTL(C3;D3;1;FILTER(Holiday;Holiday[#Headers]='base dati'!G3))-1;"n/a")&lt;/P&gt;&lt;P&gt;D3 is the date of delivery C3 is the date of the entrust of the delivery.&lt;/P&gt;&lt;P&gt;Holiday is the table below&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to do the same in Power Bi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this formula to calculate the difference, but I dont'know how to apply the excel FILTER formula&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Data consegna]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Data consegna]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NETWORKDAYS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Data Spedizione]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Data consegna]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a sheet with the database&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have a sheet with the holidays per each European country calledPubHol&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 11:17:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3793908#M148262</guid>
      <dc:creator>elycape90</dc:creator>
      <dc:date>2024-03-27T11:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Difference date calculation considering holidays per counties</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3794514#M148283</link>
      <description>&lt;P&gt;hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="712870" data-lia-user-login="elycape90" class="lia-mention lia-mention-user"&gt;elycape90&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if you want to consider weekends and holidays in working days then simply use datediff()&lt;BR /&gt;it give you difference b/w two date&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;measure=
datediff(Sheet1[Data Spedizione], Sheet1[Data consegna],day)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 14:55:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3794514#M148283</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-03-27T14:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Difference date calculation considering holidays per counties</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3795165#M148320</link>
      <description>&lt;P&gt;Hi! But I need to consider the right holiday for each country. So how can I make it ? For ecample the first riw is related to a delivery in France which has got some holidays and the second row is related to Spain which has got other holidays&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 21:31:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3795165#M148320</guid>
      <dc:creator>elycape90</dc:creator>
      <dc:date>2024-03-27T21:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Difference date calculation considering holidays per counties</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3795785#M148355</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="712870" data-lia-user-login="elycape90" class="lia-mention lia-mention-user"&gt;elycape90&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;&amp;nbsp; for your replies, I have the following references ideas based on the more detailed information provided by &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="712870" data-lia-user-login="elycape90" class="lia-mention lia-mention-user"&gt;elycape90&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Date =
CALENDAR(
    DATE(2023,1,1),DATE(2023,12,31))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create calculated column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Days =
var _select=SELECTCOLUMNS(FILTER(ALL('PubHol'),'PubHol'[country]=EARLIER('Table'[country])),"date",'PubHol'[Festa])
return
COUNTX(
    FILTER(ALL('Date'),
    'Table'[country]=EARLIER('Table'[country])&amp;amp;&amp;amp;
    'Date'[Date]&amp;gt;=EARLIER('Table'[Date Spedizione])&amp;amp;&amp;amp;'Date'[Date]&amp;lt;=EARLIER('Table'[Data consegna])&amp;amp;&amp;amp;
    NOT('Date'[Date]) in _select),'Date'[Date])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 06:39:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3795785#M148355</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-28T06:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Difference date calculation considering holidays per counties</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3796968#M148390</link>
      <description>&lt;P&gt;hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="712870" data-lia-user-login="elycape90" class="lia-mention lia-mention-user"&gt;elycape90&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as i understand you want to count days b/w two dates with not include of weekends and holidays for that particular country&amp;nbsp;&lt;BR /&gt;if i am right then try below code with&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;data&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column 2 = 
var a = 'Table'[country]
var b = CALCULATETABLE(VALUES(PubHol[Festa]),PubHol[country]=a)
RETURN
NETWORKDAYS('Table'[Date Spedizione],'Table'[Data consegna],1,b)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer below file for solution&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;column2&lt;/STRONG&gt; is my code in &lt;STRONG&gt;Table&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if still you not get your result then please clarify your requirment&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 12:57:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-date-calculation-considering-holidays-per-counties/m-p/3796968#M148390</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-03-28T12:57:03Z</dc:date>
    </item>
  </channel>
</rss>

