<?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 Calculating Overdue Balance Over Time In Single Matrix in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Overdue-Balance-Over-Time-In-Single-Matrix/m-p/1962276#M42935</link>
    <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Been stuck on this problem for a bit - would be amazing if anyone could point out any errors in my working so far or suggest a fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I essentially have a large customer ledger table (Aged Debt) with each line representing a posting on a customers ledger. Simplified version below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Customer No&lt;/TD&gt;&lt;TD&gt;Document No&lt;/TD&gt;&lt;TD&gt;Posting Date&lt;/TD&gt;&lt;TD&gt;Due Date&lt;/TD&gt;&lt;TD&gt;Closed Date&lt;/TD&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have a Calender table as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calendar = CALENDAR(MIN(Aged_Debt[Posting Date]),MAX(Aged_Debt[Posting Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Month-Year = FORMAT('Calendar'[Date],"mmm yy")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I want to show a few things - the first being the Total Balance of the ledger at the end of the month which works fine using the following:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LastDate = MAX('Calendar'[Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Outstanding End of Month = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER (&lt;/SPAN&gt;&lt;SPAN&gt;Aged_Debt,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Aged_Debt[Posting Date] &amp;lt;= [LastDate]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Aged_Debt[Amount]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I then pull Month-Year and Outstanding End of Month into a matrix which gives the correct figures for each month. However, I also need to show the Overdue Balance.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I've tried using the below but the figures aren't correct - they're well under what they should be. When I pull Customer No into the matrix to see what is returned for each Customer, a few of the balances are actually correct but the overwhelming majority are just zero. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Overdue End of Month = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX(FILTER(Aged_Debt,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AND(OR(Aged_Debt[Closed Date]&amp;gt;[LastDate],ISBLANK(Aged_Debt[Closed Date])),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[LastDate]-Aged_Debt[Due Date]&amp;gt;=0)),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Aged_Debt[Amount])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My thinking with the above is that I need to calculate the total Amount, whilst filtering the data for anything which was either A) Closed off after the last date of each month or B) Has not yet been Closed. I also needed to see if each line was Overdue, hence the LastDate minus Due Date. If that is greater than zero it will be Overdue.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I then pulled Month-Year and Overdue End of Month into a matrix.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any help would be greatly appreciated, thanks!&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 16 Jul 2021 13:18:14 GMT</pubDate>
    <dc:creator>stuckplshelp</dc:creator>
    <dc:date>2021-07-16T13:18:14Z</dc:date>
    <item>
      <title>Calculating Overdue Balance Over Time In Single Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Overdue-Balance-Over-Time-In-Single-Matrix/m-p/1962276#M42935</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Been stuck on this problem for a bit - would be amazing if anyone could point out any errors in my working so far or suggest a fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I essentially have a large customer ledger table (Aged Debt) with each line representing a posting on a customers ledger. Simplified version below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Customer No&lt;/TD&gt;&lt;TD&gt;Document No&lt;/TD&gt;&lt;TD&gt;Posting Date&lt;/TD&gt;&lt;TD&gt;Due Date&lt;/TD&gt;&lt;TD&gt;Closed Date&lt;/TD&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have a Calender table as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calendar = CALENDAR(MIN(Aged_Debt[Posting Date]),MAX(Aged_Debt[Posting Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Month-Year = FORMAT('Calendar'[Date],"mmm yy")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I want to show a few things - the first being the Total Balance of the ledger at the end of the month which works fine using the following:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LastDate = MAX('Calendar'[Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Outstanding End of Month = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER (&lt;/SPAN&gt;&lt;SPAN&gt;Aged_Debt,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Aged_Debt[Posting Date] &amp;lt;= [LastDate]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Aged_Debt[Amount]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I then pull Month-Year and Outstanding End of Month into a matrix which gives the correct figures for each month. However, I also need to show the Overdue Balance.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I've tried using the below but the figures aren't correct - they're well under what they should be. When I pull Customer No into the matrix to see what is returned for each Customer, a few of the balances are actually correct but the overwhelming majority are just zero. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Overdue End of Month = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX(FILTER(Aged_Debt,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AND(OR(Aged_Debt[Closed Date]&amp;gt;[LastDate],ISBLANK(Aged_Debt[Closed Date])),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[LastDate]-Aged_Debt[Due Date]&amp;gt;=0)),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Aged_Debt[Amount])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My thinking with the above is that I need to calculate the total Amount, whilst filtering the data for anything which was either A) Closed off after the last date of each month or B) Has not yet been Closed. I also needed to see if each line was Overdue, hence the LastDate minus Due Date. If that is greater than zero it will be Overdue.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I then pulled Month-Year and Overdue End of Month into a matrix.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any help would be greatly appreciated, thanks!&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 Jul 2021 13:18:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Overdue-Balance-Over-Time-In-Single-Matrix/m-p/1962276#M42935</guid>
      <dc:creator>stuckplshelp</dc:creator>
      <dc:date>2021-07-16T13:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Overdue Balance Over Time In Single Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Overdue-Balance-Over-Time-In-Single-Matrix/m-p/1963520#M43008</link>
      <description>&lt;P&gt;Looks like you won't get any answers as the problem formulation is not easily digestible. Please rephrase this so that it's clear and to the point. This might help:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-Get-Your-Question-Answered-Quickly/td-p/1626726" target="_blank"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-Get-Your-Question-Answered-Quickly/td-p/1626726&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to solve &lt;STRONG&gt;one thing at a time&lt;/STRONG&gt;. Do not throw in many sub-problems into the same bag as this makes it harder for people to cook up quick solutions. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 12:25:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Overdue-Balance-Over-Time-In-Single-Matrix/m-p/1963520#M43008</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-07-17T12:25:13Z</dc:date>
    </item>
  </channel>
</rss>

