<?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 Calculate amount difference of current and previous period in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-difference-of-current-and-previous-period/m-p/4084353#M162110</link>
    <description>&lt;P&gt;Hi. Asking for help how can I calculate the difference of capex and opex based on current and previous forecast period. The current forecast period is FY24-09 and the previous is FY24-08.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, in 24-May the difference of capex is -10,000 and opex is -5,000. I wish to appear these variances in one column in table visual.&lt;/P&gt;&lt;P&gt;&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;Thank you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Third&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2024 13:48:23 GMT</pubDate>
    <dc:creator>third_hicana</dc:creator>
    <dc:date>2024-08-06T13:48:23Z</dc:date>
    <item>
      <title>Calculate amount difference of current and previous period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-difference-of-current-and-previous-period/m-p/4084353#M162110</link>
      <description>&lt;P&gt;Hi. Asking for help how can I calculate the difference of capex and opex based on current and previous forecast period. The current forecast period is FY24-09 and the previous is FY24-08.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, in 24-May the difference of capex is -10,000 and opex is -5,000. I wish to appear these variances in one column in table visual.&lt;/P&gt;&lt;P&gt;&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;Thank you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Third&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 13:48:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-difference-of-current-and-previous-period/m-p/4084353#M162110</guid>
      <dc:creator>third_hicana</dc:creator>
      <dc:date>2024-08-06T13:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount difference of current and previous period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-difference-of-current-and-previous-period/m-p/4085422#M162150</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 01:08:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-difference-of-current-and-previous-period/m-p/4085422#M162150</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-08-07T01:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount difference of current and previous period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-difference-of-current-and-previous-period/m-p/4085542#M162154</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="424059" data-lia-user-login="third_hicana" class="lia-mention lia-mention-user"&gt;third_hicana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here for your reference:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then add a measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MEASURE =
VAR _currentFYYear =
    MAX ( 'Table'[Forecast Period] )
VAR _previousFYYear =
    CALCULATE (
        MIN ( 'Table'[Forecast Period] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Forecast Period] &amp;lt; _currentFYYear )
    )
VAR _currentType =
    SELECTEDVALUE ( 'Table'[Money Type] )
RETURN
    IF (
        _previousFYYear = BLANK (),
        0,
        CALCULATE (
            SUM ( 'Table'[24-May] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[Money Type] = _currentType
                    &amp;amp;&amp;amp; 'Table'[Forecast Period] = _currentFYYear
            )
        )
            - CALCULATE (
                SUM ( 'Table'[24-May] ),
                FILTER (
                    ALLSELECTED ( 'Table' ),
                    'Table'[Money Type] = _currentType
                        &amp;amp;&amp;amp; 'Table'[Forecast Period] = _previousFYYear
                )
            )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;The result is as follow:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 02:26:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-difference-of-current-and-previous-period/m-p/4085542#M162154</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-07T02:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount difference of current and previous period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-difference-of-current-and-previous-period/m-p/4086070#M162174</link>
      <description>&lt;P&gt;Thank you very much for your help&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 07:05:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-difference-of-current-and-previous-period/m-p/4086070#M162174</guid>
      <dc:creator>third_hicana</dc:creator>
      <dc:date>2024-08-07T07:05:42Z</dc:date>
    </item>
  </channel>
</rss>

