<?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: Calculating a weighted average if date within range in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-a-weighted-average-if-date-within-range/m-p/2809826#M88914</link>
    <description>&lt;P&gt;Much appriciated&amp;nbsp;&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;. Will try it during the weekend&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 01 Oct 2022 07:17:39 GMT</pubDate>
    <dc:creator>Telli</dc:creator>
    <dc:date>2022-10-01T07:17:39Z</dc:date>
    <item>
      <title>Calculating a weighted average if date within range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-a-weighted-average-if-date-within-range/m-p/2808524#M88754</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Employer has asked me to calculate e "weighted average days" from invoices.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume that I would need to build a formula on the following logic&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sumproduct(Amount * Days(outstanding)/Total Amount&lt;/P&gt;&lt;P&gt;Where the variables would be constrained to:&lt;BR /&gt;given date is &amp;gt;issue date and &amp;lt;PayDate unless Paydate is Blank&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Invoice NO&lt;/TD&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;TD&gt;Issue Date&lt;/TD&gt;&lt;TD&gt;PayDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;TD&gt;01.01.22&lt;/TD&gt;&lt;TD&gt;15.01.22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;900&lt;/TD&gt;&lt;TD&gt;03.01.22&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;700&lt;/TD&gt;&lt;TD&gt;10.01.22&lt;/TD&gt;&lt;TD&gt;21.01.22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;1100&lt;/TD&gt;&lt;TD&gt;15.01.22&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;14.01.22 -&amp;gt; 1000x13/2600 + 900x11/2600 + 700*4/2600 = 9,884 Days&lt;/P&gt;&lt;P&gt;15.01.22 -&amp;gt; 900x12/1600+700*5/1600 = 8,9375&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried write a bunch of formulas in DAX, but I come up short when I need to filter datex "between" Issue- and PayDate while also taking into account if Paydate is null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with regards&lt;/P&gt;&lt;P&gt;telli&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 18:10:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-a-weighted-average-if-date-within-range/m-p/2808524#M88754</guid>
      <dc:creator>Telli</dc:creator>
      <dc:date>2022-09-30T18:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a weighted average if date within range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-a-weighted-average-if-date-within-range/m-p/2809678#M88888</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335776" data-lia-user-login="Telli" class="lia-mention lia-mention-user"&gt;Telli&lt;/a&gt; , refer if this blog can help &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2022 02:55:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-a-weighted-average-if-date-within-range/m-p/2809678#M88888</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-10-01T02:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a weighted average if date within range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-a-weighted-average-if-date-within-range/m-p/2809826#M88914</link>
      <description>&lt;P&gt;Much appriciated&amp;nbsp;&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;. Will try it during the weekend&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2022 07:17:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-a-weighted-average-if-date-within-range/m-p/2809826#M88914</guid>
      <dc:creator>Telli</dc:creator>
      <dc:date>2022-10-01T07:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating a weighted average if date within range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-a-weighted-average-if-date-within-range/m-p/2830347#M90145</link>
      <description>&lt;P&gt;&lt;FONT&gt;Hi，&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335776" data-lia-user-login="Telli" class="lia-mention lia-mention-user"&gt;Telli&lt;/a&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your problem has been solved,&amp;nbsp;you could accept the helpful answer as solution to close this thread.&lt;/P&gt;
&lt;P&gt;Other community members will easily find the solution when they get the same issue.&lt;/P&gt;
&lt;P&gt;If you haven't, please feel free to ask.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 08:47:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-a-weighted-average-if-date-within-range/m-p/2830347#M90145</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-10-10T08:47:58Z</dc:date>
    </item>
  </channel>
</rss>

