<?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 percentage change for a measure value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-change-for-a-measure-value/m-p/864942#M7044</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;can you please share some dummy data to reproduce the scenario. also the type of relationship beween these two tables&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure 2 = 
VAR _currDate = MAX(Table[Date])
VAR _prevDate = CALCULATE(MAX(Table[Date]),Table[Date]&amp;lt;_currDate)
VAR _prevValue = CALCULATE([YourMeasure],Table[Date]=_prevDate)
RETURN DIVIDE(([YourMeasure]-_prevValue),_prevValue,0)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 04 Dec 2019 13:02:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-12-04T13:02:59Z</dc:date>
    <item>
      <title>Calculate percentage change for a measure value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-change-for-a-measure-value/m-p/864682#M7027</link>
      <description>&lt;P&gt;So here is the scenario where I have created a measure by summing of column from different tables. Like&amp;nbsp;&lt;/P&gt;&lt;P&gt;total count = TableA[Class A count] + tableB[class B count]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I have a date coulmn which is related to both table A and Table B.&lt;/P&gt;&lt;P&gt;Now I would like to calculate the percentage increase or decrease per day of total count. Which will be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Percentage Increase = (Total count for today- total count for previous day)/ total count for previous day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to calculate this for each date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,Ankku&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 08:54:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-change-for-a-measure-value/m-p/864682#M7027</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-04T08:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate percentage change for a measure value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-change-for-a-measure-value/m-p/864942#M7044</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;can you please share some dummy data to reproduce the scenario. also the type of relationship beween these two tables&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure 2 = 
VAR _currDate = MAX(Table[Date])
VAR _prevDate = CALCULATE(MAX(Table[Date]),Table[Date]&amp;lt;_currDate)
VAR _prevValue = CALCULATE([YourMeasure],Table[Date]=_prevDate)
RETURN DIVIDE(([YourMeasure]-_prevValue),_prevValue,0)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 13:02:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-change-for-a-measure-value/m-p/864942#M7044</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-04T13:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate percentage change for a measure value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-change-for-a-measure-value/m-p/864961#M7046</link>
      <description>&lt;P&gt;So I have something like this:&lt;BR /&gt;&lt;BR /&gt;Table A&lt;BR /&gt;&amp;nbsp;Class ID&amp;nbsp; &amp;nbsp; &amp;nbsp;Sports count&amp;nbsp; &amp;nbsp; &amp;nbsp; Date&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25/09/2019&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;26/09/2019&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 32&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25/09/2019&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 02&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;26/09/2019&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table B&lt;BR /&gt;&amp;nbsp;Class ID&amp;nbsp; &amp;nbsp; &amp;nbsp;Academic count&amp;nbsp; &amp;nbsp; &amp;nbsp; Date&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25/09/2019&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;26/09/2019&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 39&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25/09/2019&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 42&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;26/09/2019&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now I need to calculate the growth % for different class ID for everyday. Like for class ID 1 the growth will be total count on 26th that is ( 12+ 14) - total count on 25th (10+ 12) which is 26-22 = 4 and then % increase will be (4/22)*100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this make my requiremnet clear. Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 13:29:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-change-for-a-measure-value/m-p/864961#M7046</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-04T13:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate percentage change for a measure value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-change-for-a-measure-value/m-p/865930#M7059</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;I assume there is one to one relationship between this two tables. If not create a key column in both the table by merging date and id&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Key = CONCATENATE(FORMAT(TableA[Date],"yyyyMMdd"),TableA[Class ID])&lt;/LI-CODE&gt;&lt;P&gt;Create similar column in table B and create one to one relationship&lt;BR /&gt;Now create a measure to get total count i.e. academic and sports&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = SUMX(TableA,TableA[Sports count])+SUMX(TableB,TableB[Academic count])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Finally create a measure to calculate percentage change&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure 2 = 
VAR _currdate = MAX(TableA[Date])
VAR _prevDate = CALCULATE(MAX(TableA[Date]),TableA[Date]&amp;lt;_currdate,ALLEXCEPT(TableA,TableA[Class ID]))
VAR _prevCount = CALCULATE([Measure],FILTER(ALLEXCEPT(TableA,TableA[Class ID]),TableA[Date]=_prevDate))
RETURN DIVIDE(([Measure]-_prevCount),_prevCount,0)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Dec 2019 05:56:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-percentage-change-for-a-measure-value/m-p/865930#M7059</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-05T05:56:29Z</dc:date>
    </item>
  </channel>
</rss>

