title: How to modify DAX expression to fill up blanks in running total Power BI
body: <p>The goal is to fill up blanks with previous values. </p>
  
  <p>Thankful to <code>@Alexis Olson</code> I was able to achieve this for development year.
  Post can be found here:</p>
  
  <p><a href="https://stackoverflow.com/questions/53619619/how-to-fill-out-blanks-in-running-total-matrix-power-bi/53622278?noredirect=1#comment95552482_53622278">How to fill out blanks in Running Total matrix Power BI</a> </p>
  
  <p>But now I need the same for <code>development month</code> and this is where I stuck. </p>
  
  <p>What I've done:</p>
  
  <p>--created calculated table <code>'Dev Months'</code> that retrieves all development months.
   --tried to modify expression by manipulating Dem Month</p>
  
  <pre><code>     Accident Month Losses1 = 
  VAR CurrDevMonth = MAX('Dev Months'[DevMonth])
  VAR MaxMonth = CALCULATE(MAX(fact_Losses[AccidentMonth]), ALLSELECTED(fact_Losses))
  VAR CurentMonth = MAX(fact_Losses[AccidentMonth])
  VAR CurentYear = MAX(fact_Losses[AccidentYear])
  RETURN
  
  
  IF(
      MONTH(
          EOMONTH(
              DATE(CurentYear - 1,12,31),
              CurrDevMonth)
       ) &gt; MaxMonth,
      BLANK(),
      CALCULATE( 
          SUM(fact_Losses[PaymentAmount]),
          FILTER(ALL(fact_Losses[DevMonth]), fact_Losses[DevMonth] &lt;= CurrDevMonth)
      )
  )
  </code></pre>
  
  <p>--Tried to use <code>AccidentDate</code> and break it down by <code>Year</code> and <code>Month</code>
  --Tried to convert <code>Year-Month</code> to <code>DATE</code>
  Still no success</p>
  
  <p>Data looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/4MNnG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4MNnG.png" alt="![![enter image description here"></a></p>
  
  <p>When I use matrix to display data I have blanks.</p>
  
  <p>Columns: Month-Year, </p>
  
  <p>Rows: Development months. Can be more than 12 since its developing over time.</p>
  
  <p>Values: Running total </p>
  
  <p>If there is a blank (no loss) then it should be populated with previous number, based on development month. </p>
  
  <p>Running Total Dax expression :</p>
  
  <pre><code>Accident Month Losses = 
  
      CALCULATE( 
      [Total Loss],
      FILTER(ALL(fact_Losses[DevMonth]),fact_Losses[DevMonth] &lt;= MAX(fact_Losses[DevMonth])
      ))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/p3ALy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p3ALy.png" alt="enter image description here"></a></p>
  
  <p>Need to be like this:</p>
  
  <p><a href="https://i.stack.imgur.com/4wqJT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4wqJT.png" alt="enter image description here"></a></p>
  
  <p>.pbix can be found here:
  <a href="https://www.dropbox.com/s/zujp6p9lbyqfez7/Test_LossTriangle.pbix?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/zujp6p9lbyqfez7/Test_LossTriangle.pbix?dl=0</a></p>
  
  <p>Please help</p>