<?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: Monthly Report with Last Month's Variance Only in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/940342#M9999</link>
    <description>&lt;P&gt;hmm, that table looks overly simplified when looking at the DAX you're using in other measures&lt;BR /&gt;This should work here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Var Last 2 =
VAR __NrOfMonthsBack = 2
VAR __MaxDate =
    EDATE (
        CALCULATE ( MAX ( 'Calendar'[Date] ), ALLSELECTED () ),
        - __NrOfMonthsBack
    )
VAR __CurrentDate =
    MAX ( 'Calendar'[Date] )
RETURN
    IF (
        __MaxDate &amp;gt;= __CurrentDate,
        BLANK (),
        SUM ( 'Table'[Amount] )
            - CALCULATE ( SUM ( 'Table'[Amount] ), PREVIOUSMONTH ( 'Calendar'[Date] ) )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT&lt;BR /&gt;ha, I thought that if measure returns blanks it wouldn't render in Matrix, but it seems that's not the case, so I guess it doesn't help you&lt;BR /&gt;you may look at the Custom Visuals&amp;nbsp;&lt;A href="https://appsource.microsoft.com/en-us/marketplace/apps?page=1&amp;amp;src=office&amp;amp;product=power-bi-visuals" target="_blank"&gt;https://appsource.microsoft.com/en-us/marketplace/apps?page=1&amp;amp;src=office&amp;amp;product=power-bi-visuals&lt;/A&gt;, but unfortunately I'm not sure there will be something suitable for you there&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2020 09:37:05 GMT</pubDate>
    <dc:creator>Stachu</dc:creator>
    <dc:date>2020-02-20T09:37:05Z</dc:date>
    <item>
      <title>Monthly Report with Last Month's Variance Only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/927554#M9454</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm certain this question has been asked a million times but all of my searching brings up the 1,000's of requests for a simple MoM variance. I've got that part handled. I'd like to show a more streamlined matrix though with several months of data with variance only for the prior 2 months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to build a report that looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here's what I currently get:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an "IsFiltered"-type pattern that will let me only show the variance once for the current month and supress it for all prior periods? Alternatively, is there a way to leave the calcs all the same but visually hide the prior month variances?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or, since I'm a finance/Excel "guy", maybe I should be showing this in some other more visual way and simply recreating my Excel Pivot Table in Poewr BI is just plain lazy...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the DAX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Current month&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Invoices By Category (w Pmts) = 
VAR
    InvoiceAmt = [Total Invoice Amount] + [Total Pmts Revenue]
RETURN
    IF(
        [BrowseDepth] &amp;gt; [MaxNodeDepth] + 1,
        BLANK(),
        IF(
            [BrowseDepth] = [MaxNodeDepth] + 1,
            CALCULATE(
                InvoiceAmt,
                FILTER(
                    VALUES( Items[IsLeaf] ),
                    Items[IsLeaf] = FALSE
                )
            ),
            InvoiceAmt
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;Last Month:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Invoices By Category (Last Month) = 
    CALCULATE(
        [Total Invoices By Category],
        PREVIOUSMONTH('Calendar'[Date])
    )&lt;/LI-CODE&gt;&lt;P&gt;Variance:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MoM Invoice &amp;amp; Pmts Variance = [Invoices By Category (w Pmts)] - [Invoices By Category (Last Month)] - [Pmts Revenue Last Month]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 20:34:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/927554#M9454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-10T20:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly Report with Last Month's Variance Only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/938531#M9899</link>
      <description>&lt;P&gt;Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).&lt;/P&gt;
&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Column1&lt;/TD&gt;
&lt;TD&gt;Column2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;2.5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 08:56:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/938531#M9899</guid>
      <dc:creator>Stachu</dc:creator>
      <dc:date>2020-02-19T08:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly Report with Last Month's Variance Only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/939223#M9942</link>
      <description>&lt;P&gt;Sure! Data looks something like this (Product ID links to product table, date to calendar, etc). Trying to show MoM change only for the most recent 2 months WITHOUT showing it for all prior months. Is this possible? Screenshot of desired and current outputs are in the original post above. Thanks in advance for any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ProductID&lt;/TD&gt;&lt;TD&gt;TrnsDate&lt;/TD&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 1&lt;/TD&gt;&lt;TD&gt;10/31/2019&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 1&lt;/TD&gt;&lt;TD&gt;11/30/2019&lt;/TD&gt;&lt;TD&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 1&lt;/TD&gt;&lt;TD&gt;12/31/2019&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 2&lt;/TD&gt;&lt;TD&gt;10/31/2019&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 2&lt;/TD&gt;&lt;TD&gt;11/30/2019&lt;/TD&gt;&lt;TD&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 2&lt;/TD&gt;&lt;TD&gt;12/31/2019&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 3&lt;/TD&gt;&lt;TD&gt;10/31/2019&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 3&lt;/TD&gt;&lt;TD&gt;11/30/2019&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 3&lt;/TD&gt;&lt;TD&gt;12/31/2019&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 19 Feb 2020 15:44:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/939223#M9942</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-19T15:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly Report with Last Month's Variance Only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/940342#M9999</link>
      <description>&lt;P&gt;hmm, that table looks overly simplified when looking at the DAX you're using in other measures&lt;BR /&gt;This should work here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Var Last 2 =
VAR __NrOfMonthsBack = 2
VAR __MaxDate =
    EDATE (
        CALCULATE ( MAX ( 'Calendar'[Date] ), ALLSELECTED () ),
        - __NrOfMonthsBack
    )
VAR __CurrentDate =
    MAX ( 'Calendar'[Date] )
RETURN
    IF (
        __MaxDate &amp;gt;= __CurrentDate,
        BLANK (),
        SUM ( 'Table'[Amount] )
            - CALCULATE ( SUM ( 'Table'[Amount] ), PREVIOUSMONTH ( 'Calendar'[Date] ) )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT&lt;BR /&gt;ha, I thought that if measure returns blanks it wouldn't render in Matrix, but it seems that's not the case, so I guess it doesn't help you&lt;BR /&gt;you may look at the Custom Visuals&amp;nbsp;&lt;A href="https://appsource.microsoft.com/en-us/marketplace/apps?page=1&amp;amp;src=office&amp;amp;product=power-bi-visuals" target="_blank"&gt;https://appsource.microsoft.com/en-us/marketplace/apps?page=1&amp;amp;src=office&amp;amp;product=power-bi-visuals&lt;/A&gt;, but unfortunately I'm not sure there will be something suitable for you there&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 09:37:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/940342#M9999</guid>
      <dc:creator>Stachu</dc:creator>
      <dc:date>2020-02-20T09:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly Report with Last Month's Variance Only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/941079#M10034</link>
      <description>&lt;P&gt;Taking a step back, any thoughts/tips for showing MoM variance? Like I said in my original post, I'm a long-time Excel user who's still fairly new to PBI. I often find myself clicking the "Matrix" button and trying to recreate a Pivet Table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's a better, more PBI friendly way, to show MoM variance for something like customer spend?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Either way, thank you so much for trying to help!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 15:02:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/941079#M10034</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-20T15:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly Report with Last Month's Variance Only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/941163#M10038</link>
      <description>&lt;P&gt;What's the purpose of the dashboard, who is the user? Here is a reference for different visuals and where to use them:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/wp-content/uploads/videotrainings/dashboarddesign/visuals-reference-may2017-A3.pdf" target="_blank"&gt;https://www.sqlbi.com/wp-content/uploads/videotrainings/dashboarddesign/visuals-reference-may2017-A3.pdf&lt;/A&gt;&lt;BR /&gt;From my experience it's always best to ask th user what information they need, and then start from there, visualizing to fit the purpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for this case - is it always last 3 months? If that's the case then you could actually build few measures calculating relative to your max date, e.g. LastMonth-2,&amp;nbsp;LastMonth-1, LastMonth, Last 3 Months, Var LM vs LM-1, etc.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 16:04:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/941163#M10038</guid>
      <dc:creator>Stachu</dc:creator>
      <dc:date>2020-02-20T16:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly Report with Last Month's Variance Only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/942914#M10094</link>
      <description>&lt;P&gt;Thanks for the tips Statchu. I hadn't run across that SQLBI info graphic before. Very good stuff!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 14:40:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-Report-with-Last-Month-s-Variance-Only/m-p/942914#M10094</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-21T14:40:05Z</dc:date>
    </item>
  </channel>
</rss>

