<?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: Calculate difference between columns in matrix visual in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1585595#M31731</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="268874" data-lia-user-login="rbustamante" class="lia-mention lia-mention-user"&gt;rbustamante&lt;/a&gt; , With help from date table , First seem diff day vs last &lt;/P&gt;
&lt;P&gt;Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]&amp;lt;max('Date'[Date])),'Date'[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This Day = CALCULATE([sales], FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diff = [This Day] - [Last Day Non Continuous]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Between first and last date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new measure =&lt;BR /&gt;var _min = minx(allselected('Date'), 'Date'[Date])&lt;BR /&gt;var _max = maxx(allselected('Date'), 'Date'[Date])&lt;BR /&gt;return &lt;BR /&gt;calculate([measure], filter( 'Date', 'Date'[Date] =_max )) -calculate([measure], filter( 'Date', 'Date'[Date] =_min )))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new measure =&lt;BR /&gt;var _min = minx(allselected('Date'), 'Date'[Date])&lt;BR /&gt;var _max = maxx(allselected('Date'), 'Date'[Date])&lt;BR /&gt;return &lt;BR /&gt;calculate([measure], filter( Table, Table[Date] =_max )) -calculate([measure], filter( Table, Table[Date] =_min )))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use date Table&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jan 2021 01:42:08 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-01-07T01:42:08Z</dc:date>
    <item>
      <title>Calculate difference between columns in matrix visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1585523#M31729</link>
      <description>&lt;P&gt;I have the following matrix visual:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I need two things&amp;nbsp;when the user clicks on the "Date slicer":&lt;/P&gt;&lt;P&gt;1) dynamically calculate the difference between the ammount of two dates. Ammount of 31/12/2020 less ammount of 30/04/2020.&lt;/P&gt;&lt;P&gt;2) dynamically calculate the difference between the ammount of the last date 31/12/2020 and the ammount of the first date 31/12/2019&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 00:01:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1585523#M31729</guid>
      <dc:creator>rbustamante</dc:creator>
      <dc:date>2021-01-07T00:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference between columns in matrix visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1585595#M31731</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="268874" data-lia-user-login="rbustamante" class="lia-mention lia-mention-user"&gt;rbustamante&lt;/a&gt; , With help from date table , First seem diff day vs last &lt;/P&gt;
&lt;P&gt;Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]&amp;lt;max('Date'[Date])),'Date'[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This Day = CALCULATE([sales], FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diff = [This Day] - [Last Day Non Continuous]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Between first and last date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new measure =&lt;BR /&gt;var _min = minx(allselected('Date'), 'Date'[Date])&lt;BR /&gt;var _max = maxx(allselected('Date'), 'Date'[Date])&lt;BR /&gt;return &lt;BR /&gt;calculate([measure], filter( 'Date', 'Date'[Date] =_max )) -calculate([measure], filter( 'Date', 'Date'[Date] =_min )))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new measure =&lt;BR /&gt;var _min = minx(allselected('Date'), 'Date'[Date])&lt;BR /&gt;var _max = maxx(allselected('Date'), 'Date'[Date])&lt;BR /&gt;return &lt;BR /&gt;calculate([measure], filter( Table, Table[Date] =_max )) -calculate([measure], filter( Table, Table[Date] =_min )))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use date Table&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 01:42:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1585595#M31731</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-01-07T01:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference between columns in matrix visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1586399#M31767</link>
      <description>&lt;P&gt;Thank for the response but not works. It is not posible to know the difference between months.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 14:24:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1586399#M31767</guid>
      <dc:creator>rbustamante</dc:creator>
      <dc:date>2021-01-07T14:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference between columns in matrix visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1586519#M31770</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="268874" data-lia-user-login="rbustamante" class="lia-mention lia-mention-user"&gt;rbustamante&lt;/a&gt;&amp;nbsp; Should be pretty easy, share a PBIX file with sample data.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 15:45:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1586519#M31770</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2021-01-07T15:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference between columns in matrix visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1587094#M31801</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I try to explain better:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In this case I choose 3 dates and I need to know de difference between Ammount 31/03/2020 and 31/12/2019 and the difference between 30/04/2020 and 31/03/2020.&lt;/P&gt;&lt;P&gt;If I choose different dates I need to know the diferences between amounts at these dates.&lt;/P&gt;&lt;P&gt;I share the file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 00:44:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1587094#M31801</guid>
      <dc:creator>rbustamante</dc:creator>
      <dc:date>2021-01-08T00:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference between columns in matrix visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1587099#M31802</link>
      <description>&lt;P&gt;Sorry it is not posible to share the pbix file&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 00:47:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1587099#M31802</guid>
      <dc:creator>rbustamante</dc:creator>
      <dc:date>2021-01-08T00:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference between columns in matrix visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1589960#M31923</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="268874" data-lia-user-login="rbustamante" class="lia-mention lia-mention-user"&gt;rbustamante&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the data you provided here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-calculate-measure-based-on-previous-date/m-p/1589940" target="_self"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-calculate-measure-based-on-previous-date/m-p/1589940&lt;/A&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;mDifference = 
VAR _CurrentDate =
    SELECTEDVALUE ( 'Products (2)'[Date])
VAR _PreviousDate =
    CALCULATE (
        MAX ( 'Products (2)'[Date] ),
        ALLSELECTED ( 'Products (2)'[Date] ),
        KEEPFILTERS ( 'Products (2)'[Date] &amp;lt; _CurrentDate )
    )
VAR _ThisMonth =
    CALCULATE ( SUM ( 'Products (2)'[Amount] ) )
VAR _PreviousMonth =
    CALCULATE (
        SUM ( 'Products (2)'[Amount] ),
        'Products (2)'[Date] = _PreviousDate
    )
RETURN
    _ThisMonth - _PreviousMonth&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:32:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-columns-in-matrix-visual/m-p/1589960#M31923</guid>
      <dc:creator>Payeras_BI</dc:creator>
      <dc:date>2021-01-14T16:32:52Z</dc:date>
    </item>
  </channel>
</rss>

