<?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 Previous month of last month in dataset in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4253185#M168466</link>
    <description>&lt;P&gt;I am trying to create a KPI visual that shows the sum of the last month in the dataset compared to the sum of the previous month (of the last month in the data set). To do this, I created a measure to calculate the previous month total:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PreviousMonth = CALCULATE(SUM('CompPayments'[Payment Amount]), PREVIOUSMONTH('CompPayments'[Payment Received Date].[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the KPI card shows blank because it's calculating based on current month but I will never have data for the current month.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, we are in October but the last month in my dataset is September so I need it to show total of September with the target "goal" being the sum of August. When November hits and I update the dataset, I need it to show October vs September, etc.&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;</description>
    <pubDate>Tue, 22 Oct 2024 22:10:48 GMT</pubDate>
    <dc:creator>mariahMC</dc:creator>
    <dc:date>2024-10-22T22:10:48Z</dc:date>
    <item>
      <title>Previous month of last month in dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4253185#M168466</link>
      <description>&lt;P&gt;I am trying to create a KPI visual that shows the sum of the last month in the dataset compared to the sum of the previous month (of the last month in the data set). To do this, I created a measure to calculate the previous month total:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PreviousMonth = CALCULATE(SUM('CompPayments'[Payment Amount]), PREVIOUSMONTH('CompPayments'[Payment Received Date].[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the KPI card shows blank because it's calculating based on current month but I will never have data for the current month.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, we are in October but the last month in my dataset is September so I need it to show total of September with the target "goal" being the sum of August. When November hits and I update the dataset, I need it to show October vs September, etc.&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;</description>
      <pubDate>Tue, 22 Oct 2024 22:10:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4253185#M168466</guid>
      <dc:creator>mariahMC</dc:creator>
      <dc:date>2024-10-22T22:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month of last month in dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4253387#M168476</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="829283" data-lia-user-login="mariahMC" class="lia-mention lia-mention-user"&gt;mariahMC&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please &lt;STRONG&gt;update&lt;/STRONG&gt; the formula of measure [&lt;SPAN&gt;PreviousMonth&lt;/SPAN&gt;] as below and check if it can return the expected result...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;PreviousMonth =
CALCULATE (
    SUM ( 'CompPayments'[Payment Amount] ),
    PREVIOUSMONTH ( 'CompPayments'[Payment Received Date] )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 02:29:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4253387#M168476</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-23T02:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month of last month in dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4253534#M168487</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Without seeing your semantic model, I can't be entirely certain, but it seems likely that the latest month is being defined in your model using the &lt;CODE&gt;TODAY()&lt;/CODE&gt; function in a measure.&lt;/P&gt;
&lt;P&gt;If that’s the case, I recommend using the last date from the fact table instead of &lt;CODE&gt;TODAY()&lt;/CODE&gt; to define the latest month. This way, the latest month will always display the data (no blank), allowing you to compare it with the previous month.&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 04:59:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4253534#M168487</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-10-23T04:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month of last month in dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4254723#M168544</link>
      <description>&lt;P&gt;I made this change and it gives me September total, but the Goal is blank and not calculating the total of August&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 15:56:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4254723#M168544</guid>
      <dc:creator>mariahMC</dc:creator>
      <dc:date>2024-10-23T15:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month of last month in dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4254727#M168545</link>
      <description>&lt;P&gt;Right now I am only using one data source in my model as practice since I am new to power bi. Eventually I will add additional sources to my model. Do I need to create a date table?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 16:00:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4254727#M168545</guid>
      <dc:creator>mariahMC</dc:creator>
      <dc:date>2024-10-23T16:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month of last month in dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4254749#M168546</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I suggest to create a date table.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 16:14:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4254749#M168546</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-10-23T16:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month of last month in dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4260648#M168856</link>
      <description>&lt;P&gt;Thanks! I created a date table and filtered by maxdate and that seems to work for now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPA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IV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DATEADD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 28 Oct 2024 14:13:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-month-of-last-month-in-dataset/m-p/4260648#M168856</guid>
      <dc:creator>mariahMC</dc:creator>
      <dc:date>2024-10-28T14:13:02Z</dc:date>
    </item>
  </channel>
</rss>

