<?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: How to calcul the sum on fild filtred by two dates slicers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calcul-the-sum-on-fild-filtred-by-two-dates-slicers/m-p/2347684#M59415</link>
    <description>&lt;P&gt;Hello &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much, I will test those solutions and will update you asap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the solution that I used is that i declared juste one dimDate and I did two inactive relationships consucutively with start_date_history&amp;nbsp; and&amp;nbsp; end_date_history and then I did a calculate sum with two filter&lt;/P&gt;&lt;P&gt;the firest one when MIN(dimDATE) &amp;lt;= start_date_history&amp;nbsp; and the second filter with MAX(dimDATE)&amp;gt;=end_date_history&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I don't know if it is optimised if we consider the performance ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your help&lt;/P&gt;</description>
    <pubDate>Fri, 18 Feb 2022 12:29:30 GMT</pubDate>
    <dc:creator>ouafaa</dc:creator>
    <dc:date>2022-02-18T12:29:30Z</dc:date>
    <item>
      <title>How to calcul the sum on fild filtred by two dates slicers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calcul-the-sum-on-fild-filtred-by-two-dates-slicers/m-p/2345698#M59329</link>
      <description>&lt;P&gt;I have the tables :&lt;BR /&gt;Reference_products wich contains fields : Ref_product libelle, produit&lt;BR /&gt;product_history wich contains columns : ref_product_hist, ref_product, start_date_history and end_date_history and number_product_available&lt;BR /&gt;dimDateStart&lt;BR /&gt;dimDateEnd&lt;/P&gt;&lt;P&gt;the table product_history table is linked to 2 calendar tables:&lt;BR /&gt;dimDateStart through the start_history_date field&lt;BR /&gt;dimDateEnd through the end_history_date field&lt;/P&gt;&lt;P&gt;I need to have in my report 2 date slicers : the first one to choise a start date and another to choise an end date&lt;BR /&gt;and I need to have a mesure wich calculate the sum of the number_product_available field in the table start_history_date&lt;BR /&gt;where :&lt;BR /&gt;start_history_date &amp;gt; selected date from the first slicer date (dimDateStart)&lt;BR /&gt;and end_history_date &amp;lt; selected date from the end date slicer (dimDateEnd)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is my model :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NB: I just start learning dax and I have no idea how I could do it, I thank you for any help&lt;BR /&gt;you will find my source file and my pbix in this link : &lt;A href="https://we.tl/t-phCWQvx889" target="_blank"&gt;https://we.tl/t-phCWQvx889&lt;/A&gt;&lt;BR /&gt;I thank you again&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 18:30:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calcul-the-sum-on-fild-filtred-by-two-dates-slicers/m-p/2345698#M59329</guid>
      <dc:creator>ouafaa</dc:creator>
      <dc:date>2022-02-17T18:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to calcul the sum on fild filtred by two dates slicers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calcul-the-sum-on-fild-filtred-by-two-dates-slicers/m-p/2346459#M59369</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="54815" data-lia-user-login="ouafaa" class="lia-mention lia-mention-user"&gt;ouafaa&lt;/a&gt; , I think it can work with an independent date table / Or two independent date table(Do not join) , If you join Before or after slicer or use crossfilter to remove join &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Date1, Date2 are independent tables&lt;/P&gt;
&lt;P&gt;new measure =&lt;BR /&gt;var _max = maxx(allselected(Date2),Date2[Date])&lt;BR /&gt;var _min = mainx(allselected(Date1),Date1[Date]) &lt;BR /&gt;return &lt;BR /&gt;calculate( sum(Table[Value]), filter('Table', 'Table'[start_date_history ] &amp;gt;=_min &amp;amp;&amp;amp; 'Table'[end_date_history ] &amp;lt;=_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Date are joined&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new measure =&lt;BR /&gt;var _max = maxx(allselected(Date2),Date2[Date])&lt;BR /&gt;var _min = mainx(allselected(Date1),Date1[Date]) &lt;BR /&gt;return &lt;BR /&gt;calculate( sum(Table[Value]), filter('Table', 'Table'[start_date_history ] &amp;gt;=_min &amp;amp;&amp;amp; 'Table'[end_date_history ] &amp;lt;=_max) ,CROSSFILTER ( Table[start_date_history ], Date1[Date], NONE )&lt;/P&gt;
&lt;P&gt;CROSSFILTER ( Table[end_date_history ], Date2[Date], NONE ) )&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 04:18:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calcul-the-sum-on-fild-filtred-by-two-dates-slicers/m-p/2346459#M59369</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-02-18T04:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to calcul the sum on fild filtred by two dates slicers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calcul-the-sum-on-fild-filtred-by-two-dates-slicers/m-p/2347684#M59415</link>
      <description>&lt;P&gt;Hello &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much, I will test those solutions and will update you asap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the solution that I used is that i declared juste one dimDate and I did two inactive relationships consucutively with start_date_history&amp;nbsp; and&amp;nbsp; end_date_history and then I did a calculate sum with two filter&lt;/P&gt;&lt;P&gt;the firest one when MIN(dimDATE) &amp;lt;= start_date_history&amp;nbsp; and the second filter with MAX(dimDATE)&amp;gt;=end_date_history&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I don't know if it is optimised if we consider the performance ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your help&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 12:29:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calcul-the-sum-on-fild-filtred-by-two-dates-slicers/m-p/2347684#M59415</guid>
      <dc:creator>ouafaa</dc:creator>
      <dc:date>2022-02-18T12:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to calcul the sum on fild filtred by two dates slicers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calcul-the-sum-on-fild-filtred-by-two-dates-slicers/m-p/2358173#M60143</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="54815" data-lia-user-login="ouafaa" class="lia-mention lia-mention-user"&gt;ouafaa&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could not reach the file.&lt;/P&gt;
&lt;P&gt;Does the problem be solved?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jay&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 08:50:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calcul-the-sum-on-fild-filtred-by-two-dates-slicers/m-p/2358173#M60143</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-24T08:50:16Z</dc:date>
    </item>
  </channel>
</rss>

