<?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: Creating increase/decrease rate with irregular date column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-increase-decrease-rate-with-irregular-date-column/m-p/3640046#M140909</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like, but please try something like below whether it suits your requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Population Change Rate =
VAR CurrentDate =
    SELECTEDVALUE ( 'Table'[date] )
VAR CurrentPopulation =
    CALCULATE ( SUM ( 'Table'[population] ), 'Table'[date] = CurrentDate )
VAR PreviousDate =
    CALCULATE (
        MAX ( 'Table'[date] ),
        FILTER ( ALL ( 'Table' ), 'Table'[date] &amp;lt; CurrentDate )
    )
VAR PreviousPopulation =
    CALCULATE (
        SUM ( 'Table'[population] ),
        FILTER ( ALL ( 'Table' ), 'Table'[date] = PreviousDate )
    )
RETURN
    IF (
        NOT ISBLANK ( PreviousPopulation ),
        ( CurrentPopulation - PreviousPopulation ) / PreviousPopulation,
        BLANK ()
    )
&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 16 Jan 2024 03:42:08 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2024-01-16T03:42:08Z</dc:date>
    <item>
      <title>Creating increase/decrease rate with irregular date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-increase-decrease-rate-with-irregular-date-column/m-p/3638873#M140845</link>
      <description>&lt;P&gt;I have ireegular date values. For example, data before 2023(2021,2021,etc.) only contains December data (integrated), and for 2023, only September and October exist. the cumulative population graph trend is drawn well, but I'm trying to see the rate of change by vomparing the values with the previous month's data, but the dax function doesn't work. It seems to be more difficult because the date values are not sequential. I just need to know the rate of change compared to the previous value of the existing date. Could you please five me some tips?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I wort my own dax function. CurrentDate, currentPopulation, and PreviousDate are returnde well, but only the PreviousPopulation value is not returned well. Why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Population Change Rate =&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR CurrentDate = SELECTEDVALUE('Table'[date])&lt;/P&gt;&lt;P&gt;VAR CurrentPopulation = CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SUM('Table'[population])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Table'[date] = CurrentDate&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;VAR PreviousDate = CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; MAX('Table'[date])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALL('Table'),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Table'[date] &amp;lt; CurrentDate&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;VAR PreviousPopulation = CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SUM('Table'[population]},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Table'[date] = PreviousDate&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN IF(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; NOT ISBLANK(PreviousPopulation),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; (CurrentPopulation - PreviousPopulation) / PreviousPopulation,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; BLANK()&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Please understand that I am not good at English beacuse I am Korean.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 13:08:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-increase-decrease-rate-with-irregular-date-column/m-p/3638873#M140845</guid>
      <dc:creator>gameplane</dc:creator>
      <dc:date>2024-01-15T13:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating increase/decrease rate with irregular date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-increase-decrease-rate-with-irregular-date-column/m-p/3640046#M140909</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like, but please try something like below whether it suits your requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Population Change Rate =
VAR CurrentDate =
    SELECTEDVALUE ( 'Table'[date] )
VAR CurrentPopulation =
    CALCULATE ( SUM ( 'Table'[population] ), 'Table'[date] = CurrentDate )
VAR PreviousDate =
    CALCULATE (
        MAX ( 'Table'[date] ),
        FILTER ( ALL ( 'Table' ), 'Table'[date] &amp;lt; CurrentDate )
    )
VAR PreviousPopulation =
    CALCULATE (
        SUM ( 'Table'[population] ),
        FILTER ( ALL ( 'Table' ), 'Table'[date] = PreviousDate )
    )
RETURN
    IF (
        NOT ISBLANK ( PreviousPopulation ),
        ( CurrentPopulation - PreviousPopulation ) / PreviousPopulation,
        BLANK ()
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 16 Jan 2024 03:42:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-increase-decrease-rate-with-irregular-date-column/m-p/3640046#M140909</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-01-16T03:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating increase/decrease rate with irregular date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-increase-decrease-rate-with-irregular-date-column/m-p/3640075#M140912</link>
      <description>&lt;P&gt;Thank you soooooooooo much!!!!!!!!!!!!!!!!!!!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 04:17:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-increase-decrease-rate-with-irregular-date-column/m-p/3640075#M140912</guid>
      <dc:creator>gameplane</dc:creator>
      <dc:date>2024-01-16T04:17:01Z</dc:date>
    </item>
  </channel>
</rss>

