<?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 rows with filters from another table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-rows-with-filters-from-another-table/m-p/1192068#M18863</link>
    <description>&lt;LI-CODE lang="csharp"&gt;// T1 with prod data: OrderDate, DeliveryDate
// T2 with hols and weekends: ExclusionDate

[Num Of Working Days] = // calculated column in T1
var __startDate = T1[OrderDate]
var __endDate = T1[DeliveryDate]
var __holidayAndWeekendCount =
	COUNTROWS(
		FILTER(
			T2,
			T2[ExclusionDate] &amp;gt;= __startDate
			&amp;amp;&amp;amp;
			T2[ExclusionDate] &amp;lt;= __endDate
		)
	)
var __result =
	__endDate - __startDate
		+ 1 - __holidayAndWeekendCount
return
	__result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jun 2020 11:30:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-06-30T11:30:53Z</dc:date>
    <item>
      <title>Count rows with filters from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-rows-with-filters-from-another-table/m-p/1191745#M18846</link>
      <description>&lt;P&gt;Good Morning,&lt;/P&gt;&lt;P&gt;I have a problem and I don't know how to solve it.&lt;/P&gt;&lt;P&gt;I have 2 tables, the first with all the production data and the second with a single column where there are the days that are holidays and weekends. The days that are working days do not appear in that second table.&lt;/P&gt;&lt;P&gt;In the first table I have 2 fields that are dated, the first the Date when the order was placed, and the other when the product must be delivered to the customer.&lt;/P&gt;&lt;P&gt;The goal of everything, is that I have to get to know the number of working days between the 2 dates.&lt;/P&gt;&lt;P&gt;I already have the part of the difference between the dates, but I don't know how to subtract the number of Holidays that come from the other Table.&lt;BR /&gt;I have tried it with the COUNTROWS and FILTER functions, but I cannot solve it ...&lt;/P&gt;&lt;P&gt;Could you help me?&lt;/P&gt;&lt;P&gt;Thanks and greetings,&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 09:35:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-rows-with-filters-from-another-table/m-p/1191745#M18846</guid>
      <dc:creator>joupuma</dc:creator>
      <dc:date>2020-06-30T09:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Count rows with filters from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-rows-with-filters-from-another-table/m-p/1191835#M18848</link>
      <description>Do you also have a DimDate table? You will need one for this problem, then you just need to relate the Holidays to the date table, and FILTER the DimDate for Working Days and do a COUNTROWS on that in combination with the DATEDIFF.</description>
      <pubDate>Tue, 30 Jun 2020 10:00:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-rows-with-filters-from-another-table/m-p/1191835#M18848</guid>
      <dc:creator>AllisonKennedy</dc:creator>
      <dc:date>2020-06-30T10:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count rows with filters from another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-rows-with-filters-from-another-table/m-p/1192068#M18863</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// T1 with prod data: OrderDate, DeliveryDate
// T2 with hols and weekends: ExclusionDate

[Num Of Working Days] = // calculated column in T1
var __startDate = T1[OrderDate]
var __endDate = T1[DeliveryDate]
var __holidayAndWeekendCount =
	COUNTROWS(
		FILTER(
			T2,
			T2[ExclusionDate] &amp;gt;= __startDate
			&amp;amp;&amp;amp;
			T2[ExclusionDate] &amp;lt;= __endDate
		)
	)
var __result =
	__endDate - __startDate
		+ 1 - __holidayAndWeekendCount
return
	__result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 11:30:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-rows-with-filters-from-another-table/m-p/1192068#M18863</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-30T11:30:53Z</dc:date>
    </item>
  </channel>
</rss>

