Forum Discussion

renevandeveen's avatar
renevandeveen
Frequent Visitor
6 years ago

Starting measure calculation with value in previous 'row'

Hello,

 

I am having an issue with the following measure calculation.

 

I am trying to calculate a beginning inventory level for one month/week/day. The first inventory level is given and obtained from an Excel file. I call this the "starting inventory value". I then have two measures that indicate the "purchased order value" and the "Forecast Value". 

 

All are measures. 

 

I would now like to see that the Starting Inventory Value picks the value up of the ending inventory value of the previous month. The EARLIER functionality doesn't work since it is a measure and it can't be done in a calculated column. 

 

Any ideas on how this could be done? 

 

Thanks in Advance!

 

2 Replies

  • renevandeveen ,

    Can you share sample data and sample output.

     

    It needs to be done differently.  If I want to use last month in my calculation and last month is dependent on it last month, means I do not have data to calculate. Sometimes we use cumulative values(from the start of time) to deal with it.  Unlike excel I can not cell one after another

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI renevandeveen,

    Do you mean the recursive calculation that invokes the current measure formula 'previous row' calculation result? If this is a case, it is impossible. Power bi data model tables do not contain row/column index, its calculation is based on row contents filters.
    For recursive calculation, it means you need to add correspond calculation formulas for all rows and use a particular row index to find out match calculation formula results.

    Regards,

    Xiaoxin Sheng