<?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 Measure with filtering from two date fields in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-filtering-from-two-date-fields/m-p/2882804#M93359</link>
    <description>&lt;P&gt;I have a data model with a measure for order amount. For simplicity:&lt;BR /&gt;-Fact table has four columns: order number, order amount, delivery_date, order_date.&lt;BR /&gt;-The fact table is connected with a dim table (Calendar) to the order_date column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to calculate orders for the current order_date period (filtered with a slicer) BUT&lt;BR /&gt;it should exclude orders with delivery_dates that are outside the region.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried to explicitly define the filter in the calculate but it seems to always also&lt;BR /&gt;include the implicit filters and/or include too much of the dim. I would like to have the result on the same granularity as the fact. Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried (to no avail) :&amp;nbsp;&lt;/P&gt;&lt;P&gt;order amount = CALCULATE(&lt;BR /&gt;SUM (Sales[orders]),&lt;/P&gt;&lt;P&gt;FILTER('Sales',&lt;BR /&gt;Sales[delivery_date] &amp;lt;= CALCULATE(&lt;BR /&gt;MAX('Calendar'[Date]),KEEPFILTERS('Calendar'[Date]))))&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2022 12:07:40 GMT</pubDate>
    <dc:creator>datamortar</dc:creator>
    <dc:date>2022-11-03T12:07:40Z</dc:date>
    <item>
      <title>Measure with filtering from two date fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-filtering-from-two-date-fields/m-p/2882804#M93359</link>
      <description>&lt;P&gt;I have a data model with a measure for order amount. For simplicity:&lt;BR /&gt;-Fact table has four columns: order number, order amount, delivery_date, order_date.&lt;BR /&gt;-The fact table is connected with a dim table (Calendar) to the order_date column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to calculate orders for the current order_date period (filtered with a slicer) BUT&lt;BR /&gt;it should exclude orders with delivery_dates that are outside the region.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried to explicitly define the filter in the calculate but it seems to always also&lt;BR /&gt;include the implicit filters and/or include too much of the dim. I would like to have the result on the same granularity as the fact. Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried (to no avail) :&amp;nbsp;&lt;/P&gt;&lt;P&gt;order amount = CALCULATE(&lt;BR /&gt;SUM (Sales[orders]),&lt;/P&gt;&lt;P&gt;FILTER('Sales',&lt;BR /&gt;Sales[delivery_date] &amp;lt;= CALCULATE(&lt;BR /&gt;MAX('Calendar'[Date]),KEEPFILTERS('Calendar'[Date]))))&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 12:07:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-filtering-from-two-date-fields/m-p/2882804#M93359</guid>
      <dc:creator>datamortar</dc:creator>
      <dc:date>2022-11-03T12:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Measure with filtering from two date fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-filtering-from-two-date-fields/m-p/2884411#M93464</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="466326" data-lia-user-login="datamortar" class="lia-mention lia-mention-user"&gt;datamortar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you provide &lt;/SPAN&gt;&lt;SPAN&gt;s&lt;/SPAN&gt;&lt;SPAN&gt;ample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures. I look forward to your response.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 03:31:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-filtering-from-two-date-fields/m-p/2884411#M93464</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2022-11-04T03:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Measure with filtering from two date fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-filtering-from-two-date-fields/m-p/2886446#M93569</link>
      <description>&lt;P&gt;Hi! Here is a snippet of the data with some of it randomized.&amp;nbsp;&lt;A href="https://www.dropbox.com/s/2k4vit6es7i0z49/question.pbix?dl=0" target="_blank"&gt;https://www.dropbox.com/s/2k4vit6es7i0z49/question.pbix?dl=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The problem is now that I can't have the dim calendar in the resulting table.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 19:24:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-filtering-from-two-date-fields/m-p/2886446#M93569</guid>
      <dc:creator>datamortar</dc:creator>
      <dc:date>2022-11-04T19:24:23Z</dc:date>
    </item>
  </channel>
</rss>

