title: Power Bi Calculate Growth Over Last Month and Show it in a Matrix
body: <p>I have a below matrix. I want to calculate the <code>% Growth over month</code> and to show in a matrix</p>
  <p><a href="https://i.stack.imgur.com/nyJxW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nyJxW.png" alt="Sample Screenshot of Matrix visual" /></a></p>
  <p><strong>Fields</strong></p>
  <p><a href="https://i.stack.imgur.com/30jHc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/30jHc.png" alt="Fields used in Maatrix" /></a></p>
  <p><strong>Expected Output</strong></p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Company</th>
  <th>August</th>
  <th>September</th>
  <th>GOLM %</th>
  <th>Total</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>EBS-EASEBUSINESS SOLUTIONS</td>
  <td>5940</td>
  <td>0</td>
  <td>-100%</td>
  <td>5940</td>
  </tr>
  <tr>
  <td>    SWEETREAT CAFE</td>
  <td>5940</td>
  <td>0</td>
  <td>-100%</td>
  <td>5940</td>
  </tr>
  <tr>
  <td>        M/S SPORTS ONE PHARMACY</td>
  <td>1188</td>
  <td></td>
  <td>-100%</td>
  <td>1188</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p><strong>Tried Solution</strong></p>
  <p>I have tried this <a href="https://community.powerbi.com/t5/Desktop/Calculating-Growth-in-a-Matrix-adding-a-column/m-p/833789#M400450" rel="nofollow noreferrer">Solution</a>. But it's not working for me</p>
  <pre><code>GOLM = 
  VAR SelectedMonth =
  SELECTEDVALUE (
     Dates[Month],
       MONTH ( TODAY () )
   )
  
   VAR PrevMonth =
    SELECTEDVALUE (
     'Source Data'[Month Updates],
       MONTH ( TODAY () )
    ) - 1
  
    VAR Growth =
     CALCULATE(
     DIVIDE(
      SelectedMonth - PrevMonth,
      PrevMonth,
      0
      )
      )
  
      RETURN
      IF(
      SELECTEDVALUE('Source Data'[Month Updates]) = PrevMonth,
      SUM('Source Data'[SALES VALUE]),
      IF(
      SELECTEDVALUE('Source Data'[Month Updates]) = SelectedMonth,
      SUM('Source Data'[SALES VALUE]),
      FORMAT(Growth, &quot;Percent&quot;)
  
       )
       )
  </code></pre>
  <p><strong>Error</strong></p>
  <p><a href="https://i.stack.imgur.com/GSshA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GSshA.png" alt="Error Screenshot" /></a></p>
  <p><strong>DAX File</strong></p>
  <p>Here is my <a href="https://drive.google.com/file/d/1t5p4UP3lOex9V2doBkBUf6ITMkC9gMrH/view?usp=sharing" rel="nofollow noreferrer">Dax</a> File</p>