<?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 Difference between current month and previous month Percentage in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4133456#M164202</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have a monthwise Percentage data, when i filter month on the top, it is required to show the difference between current month and previous month Percentage. Please help with DAX function&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2024 13:20:03 GMT</pubDate>
    <dc:creator>Sekharnaga</dc:creator>
    <dc:date>2024-09-04T13:20:03Z</dc:date>
    <item>
      <title>Difference between current month and previous month Percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4133456#M164202</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have a monthwise Percentage data, when i filter month on the top, it is required to show the difference between current month and previous month Percentage. Please help with DAX function&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 13:20:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4133456#M164202</guid>
      <dc:creator>Sekharnaga</dc:creator>
      <dc:date>2024-09-04T13:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between current month and previous month Percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4134084#M164206</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="703182" data-lia-user-login="Sekharnaga" class="lia-mention lia-mention-user"&gt;Sekharnaga&lt;/a&gt;, give this a try, and if you encounter any issues, let me know.&lt;BR /&gt;Replace "Table" with the name of your table and "DateColumn" with the name of your column.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Difference_Current_Prev_Month = 
VAR CurrentMonthPercentage = SELECTEDVALUE(Table[Percentage])
VAR PreviousMonthPercentage = 
    CALCULATE(
        SELECTEDVALUE(Table[Percentage]),
        PREVIOUSMONTH(Table[DateColumn])
    )
RETURN
    CurrentMonthPercentage - PreviousMonthPercentage&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="center"&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Did I answer your question?&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;If so, please mark my post as the solution! &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Your Kudos are much appreciated!&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Proud to be a Solution Specialist!&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 19:48:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4134084#M164206</guid>
      <dc:creator>ahadkarimi</dc:creator>
      <dc:date>2024-09-04T19:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between current month and previous month Percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4134587#M164228</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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;LI-CODE lang="markup"&gt;Sales ratio: = 
VAR _currentyear =
    MAX ( 'calendar'[Year] )
VAR _salesyearly =
    CALCULATE (
        SUM ( sales[sales] ),
        FILTER (
            ALL ( 'calendar'[Year-Month], 'calendar'[Year-Month sort], 'calendar'[Year] ),
            'calendar'[Year] = _currentyear
        )
    )
VAR _sales =
    SUM ( sales[sales] )
RETURN
    DIVIDE ( _sales, _salesyearly )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/offset-function-dax?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;OFFSET function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous month sales ratio: = 
CALCULATE (
    [Sales ratio:],
    OFFSET (
        -1,
        ALL ( 'calendar'[Year-Month], 'calendar'[Year-Month sort] ),
        ORDERBY ( 'calendar'[Year-Month sort], ASC )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Difference: = 
IF (
    [Previous month sales ratio:],
    [Sales ratio:] - [Previous month sales ratio:]
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 04:31:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4134587#M164228</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-09-05T04:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between current month and previous month Percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4135089#M164251</link>
      <description>&lt;P&gt;Hi, I already have created meassure for Percentage. Now i want one more table to show the differnce between previous month and current month.&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 09:19:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4135089#M164251</guid>
      <dc:creator>Sekharnaga</dc:creator>
      <dc:date>2024-09-05T09:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between current month and previous month Percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4140259#M164519</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="703182" data-lia-user-login="Sekharnaga" class="lia-mention lia-mention-user"&gt;Sekharnaga&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your description, I created an example using this sample data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create measure, calculate the percentage for the current month of the current year.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MEASURE = 
VAR _month =
    SELECTEDVALUE ( 'financials'[Month Number] )
VAR _year =
    SELECTEDVALUE ( financials[Year] )
VAR _sum1 =
    CALCULATE (
        SUM ( financials[ Sales] ),
        'financials'[Month Number] = _month
            &amp;amp;&amp;amp; 'financials'[Year] = _year
    )
VAR _sum2 =
    CALCULATE (
        SUM ( financials[Gross Sales] ),
        'financials'[Month Number] = _month
            &amp;amp;&amp;amp; 'financials'[Year] = _year
    )
RETURN
    DIVIDE ( _sum1, _sum2 )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Create a measure, get the percent for the previous month, and calculate the difference.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure2 = 
VAR _month =
    SELECTEDVALUE ( 'financials'[Month Number] )
VAR _year =
    SELECTEDVALUE ( financials[Year] )
VAR _sum1 =
    CALCULATE (
        SUM ( financials[ Sales] ),
        'financials'[Month Number] = _month - 1
            &amp;amp;&amp;amp; 'financials'[Year] = _year
    )
VAR _sum2 =
    CALCULATE (
        SUM ( financials[Gross Sales] ),
        'financials'[Month Number] = _month - 1
            &amp;amp;&amp;amp; 'financials'[Year] = _year
    )
VAR _pre =
    DIVIDE ( _sum1, _sum2 )
RETURN
    IF ( _pre = BLANK (), BLANK (), [MEASURE] - _pre )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If your Current Period does not refer to this, please clarify in a follow-up reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Clara Gong&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 08:44:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-between-current-month-and-previous-month-Percentage/m-p/4140259#M164519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-09T08:44:14Z</dc:date>
    </item>
  </channel>
</rss>

