<?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: Not-quite-semi-additive measures in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-quite-semi-additive-measures/m-p/1149530#M17457</link>
    <description>&lt;P&gt;In my dates table I have "First Day of Month" and "Last Day of Month" flags. Might be worth considering?&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jun 2020 21:42:28 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2020-06-09T21:42:28Z</dc:date>
    <item>
      <title>Not-quite-semi-additive measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-quite-semi-additive-measures/m-p/1149481#M17451</link>
      <description>&lt;P&gt;I have a source table that has a snapshot of loan data for every day of the month (whether it changes or not, and no, I don't like this structure, but I'm constrained to use it for now). The sample I'm using is shown below (the actual table has many more columns, and some of them do actually change day by day, unlike what you see here).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Some of the columns in the table are "opening/closing balance" columns, like Principal Balance. This is a semi-additive measure, where I can add up the column across multiple loans, but I cannot add it over time - I must take the last snapshot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Principal Balance = CALCULATE(sum('Loan Master'[principal_balance]),LASTNONBLANK('Loan Master'[report_dt], 'Loan Master'[report_dt]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;P&gt;However, the Principal Paid and Interest Paid measures are only semi-additive *within the month*, but fully additive across months. I need to subtotal the column for the last day of *each month* within the filter context.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I just use the same measure expression as the Principal Balance above, it works within the month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Principal Paid = CALCULATE(sum('Loan Master'[principal_payment]),LASTNONBLANK('Loan Master'[report_dt],'Loan Master'[report_dt]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the totals over all months don't work (I didn't expect them to, as above):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In this case, I'd like the Total line to show $395.60 for Principal Paid and $3.50 for Interest Paid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to figure out how to use GROUPBY, SUMMARIZECOLUMNS, ADDCOLUMNS, SUMX or some combination to get it to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone care to point me in the right direction?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a &lt;A href="https://imaginetresources-my.sharepoint.com/:u:/g/personal/miked_imaginet_com/EWNjMqgPJitAhpc7iItY1lQB-v_jUJmvQNe8vcvOkMvGAw?e=eb6bmg" target="_blank" rel="noopener"&gt;sample PBIX.&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 20:40:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-quite-semi-additive-measures/m-p/1149481#M17451</guid>
      <dc:creator>xhead</dc:creator>
      <dc:date>2020-06-09T20:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Not-quite-semi-additive measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-quite-semi-additive-measures/m-p/1149530#M17457</link>
      <description>&lt;P&gt;In my dates table I have "First Day of Month" and "Last Day of Month" flags. Might be worth considering?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 21:42:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-quite-semi-additive-measures/m-p/1149530#M17457</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-09T21:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Not-quite-semi-additive measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-quite-semi-additive-measures/m-p/1160210#M17776</link>
      <description>&lt;P&gt;I fixed this myself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added a Date dimension table, related it to Loan Master by report_dt, then updated the measure expression to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Interest Payment - correct =
SUMX (
    SUMMARIZE ( 'Loan Master', 'Date'[Year Month] ),
    CALCULATE (
        SUM ( 'Loan Master'[interest_payment] ),
        LASTNONBLANK ( 'Loan Master'[report_dt], 'Loan Master'[report_dt] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://imaginetresources-my.sharepoint.com/:u:/g/personal/miked_imaginet_com/EXr4ij1zBdJFtJiAlxkAU78BPmQzOiglY1tbFq4vHCWqwQ?e=HDgkZd" target="_blank" rel="noopener"&gt;Here's my updated PBIX file.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 13:44:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-quite-semi-additive-measures/m-p/1160210#M17776</guid>
      <dc:creator>xhead</dc:creator>
      <dc:date>2020-06-15T13:44:10Z</dc:date>
    </item>
  </channel>
</rss>

